πŸ—„οΈDatabases

Databases

Databases can be categorized into two different types, Relational and Non-Relational.

Relational Databases

The most common type of database, it uses a schema to dictate the data structure we want to store.

It is made up of tables and rows, the tables in the databases are associated with keys that provide access to specific relation data. The row allows us to have multiple data structures in each table

For example, a customer database would have a table of customers with basic information relating to another table of products and payment data.

id
username
first_name

1

admin

admin

2

musky

elon

3

ross

bob

Non-Relational Databases

The NoSQL does not use tables, rows, columns, relationships or schemas. It stores data using other types of storage models, depending on what the data type will be. This makes a NoSQL DB very scalable and flexible.

The most common types of storage models are:

  • Key-Value

  • Document-Based

  • Wide-Column

  • Graph

The Key-Value model usually stores data in JSON or XML

{
  "100001": {
    "date": "01-01-2021",
    "content": "Welcome to this web application."
  },
  "100002": {
    "date": "02-01-2021",
    "content": "This is the first post on this web app."
  },
  "100003": {
    "date": "02-01-2021",
    "content": "Reminder: Tomorrow is the ..."
  }
}

Tier I

Consists of client-side applications such as a website or GUI programs. These applications consist of high-level interactions such as user login or commenting. The data is then passed to Tier II.

Tier II

It is Made up of middleware that interprets these events and puts them in a form that the DBMS can use. The application can then use the data to perform basic operations such as insert, get, update or delete data.

Two Tier Architecture

Last updated

Was this helpful?