What are databases?

Databases offer you possibilities to store information in an efficient way and structure them so you can use the information in any way you need.

Which types of databases are there?

Basically there are 2 main categories of databases:

SQL

The “Structured Query Language” (short SQL) is NO “programming language” in the typical way because it is not Turing complete.

SQL gives you the possibility to describe your data structure in a semantical way.

Example:
“Show me all users which are older than 25”
can be something like (depending on your SQL structure)

SELECT * FROM users WHERE age > 25

In SQL based database systems the main components are always: databases, tables und columns

You can somewhat compare a SQL database with an Excel sheet.

1 database = 1 excel file
1 table = 1 excel sheet in the file
1 column = 1 column in the sheet

The most common SQL commands are:

  • SELECT
  • UPDATE
  • DELETE
  • INSERT
  • CREATE DATABASE
  • CREATE TABLE

Currently popular SQL database server software are:

  • MySQL bzw. MariaDB
  • PostgreSQL
  • Oracle
  • Microsoft SQL

Main characteristic of SQL databases are the connections (aka “relations”) which can be created between columns. Thats why SQL databases are also called “relational databases“.

NoSQL

Contrary to SQL based databases NoSQL databases do not have a “fixed” structure how data is being stored.

Dependent on the used NoSQL server software use can store your data in one of the following structures:

  • Column based (similar to SQL)
  • Document based
  • Graph based
  • Key-Value based

Main advantage of this “freedom” is for example the ease of adjusting the data structure on a live instance due to the fact, that fields in an entry are saved separately and therefore have no influence on already present data in the database.

One example for such a query in a document based database (here MongoDB):

myCursor = db.inventory.find( {} )

WIth that all entries from the collection “inventory” will be returned.

Popular NoSQL database server software:

  • MongoDB (Document based)
  • Apache Casandra (Column based)
  • Neo4j (Graph based)
  • Redis (Key-Value based)

Source: https://www.xplenty.com/blog/the-sql-vs-nosql-difference/

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.