Intro

In this article, we will go over some of the most common ways of storing and retrieving data. 

Web applications typically use databases to manage their data. There are 2 main types of databases: SQL based databases and NoSQL databases. 

SQL Databases

SQL databases are relational databses. This means that an entry in a row can be related to another entry somewhere else in the database. For example, if you have a database that stores Books and Authors such as below: 

Books

_______________________
|___Id_|__Title___|_Author_|
|___0__|Aligators_|__Bob__|
|___1__|Squirrels_|__Joe__|
|___2__|Pumpkins|__Bob__|
|___3__|Eggplants|__Susie_|

Authors

_______________________
|__Id__|__Name__|_Age___|
|___0__|___Bob__|___23__|
|___1__|___Joe__|___27__|
|___2__|_Susie__|___29__|

Books with Ids 0 and 2 can be enforced to belong to the Author with an Id of 0. SQL databases enforce this relationship so that if there is a conflict with these relationships, then it will let you know (in more cases, it won’t let oyu make the change or it will throw and error). 

To learn more about SQL, this is a good interactive site for starting out: 

https://sqlbolt.com/

Examples of SQL relational databases: Postgresql, MySQL. 

Notes: 

– Databases can have tables. Tables can have Rows and Columns for storing information. 

– SQL itself stands for Structured Query Language. It is a language that is used to query databases to retrieve and store information. 

NoSQL Databases

NoSQL databases can also be queries with SQL. However, these databases do not enforce the relationships between the entries. So in theory, SQL dabases would be more stable, since it has these rules to keep the object relationships in check. However, having these rules enforced means more overhead in performance, so NoSQL databases will be faster in some areas. 

For more details on SQL vs NoSQL differences, see this article: 

https://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/?utm_source=tuicool

Examples of NoSQL databases: MongoDB, Couchbase

JSON

JSON is another way to manage data. It is a data structure stored in text format that a lot of languages/tools are able to interpret. In web development, this is usually used to communicate data between servers. When requesting information from a server, the server can go into the data base to retrieve the data, then return the results to the requester in JSON format. 

A JSON object looks like this: 

{title: “Aligators”, Author: “Bob”};

For more information on JSON, refer to this article: 

https://www.w3schools.com/js/js_json_intro.asp

Navigation

The next article can be found here. Previous article is here.