We can divide databases into two main types:

  • Relational databases

  • Non-relational databases

Relational database

A relational database is a type of database that stores data in tables. We usually connect tables by relationships; this allows the data to be easily accessed and used. For example, a “Customer” table might contain customer information such as their names, addresses, and phone numbers. But the “Customer” table might also include a relationship to the “Product” table, which would store information about each product a customer has purchased. A relational database allows the data to be easily accessed and used. Relational databases are also called SQL databases.

ACID property of a database

ACID is a set of four properties that guarantee the consistency and integrity of data in a database. The ACID properties are:

  1. Atomicity: All of the queries in a group must be executed, or none of them will be executed.

  2. Consistency: The database needs to be consistent after all of the queries in a group have been executed.

  3. Isolation: The execution of one group of queries will not affect the execution of another.

  4. Durability: The results of all of the queries in a group will be permanent, even if the system fails.

The ACID properties are essential because they guarantee that data in a database is consistent and reliable. Without the ACID properties, it would be possible for data to become corrupted or lost.

Popular relational databases

There are many different relational databases available, but some of the most popular ones include the following:

  • MySQL: is an open-source relational database, and the most popular one in use today.

  • PostgreSQL: a free and open-source relational database. It’s the most advanced open-source object-relational database in use today.

  • Microsoft SQL Server: is a commercial relational database. It is used by many large organizations.

  • IBM D2: is a commercial relational database from IBM. We can use it in large businesses and organizations.

  • SQLite: is a free and open-source relational database. It’s a popular choice for applications that need a lightweight database.

Non-relational database

Non-relational databases don’t store data in tables. Instead, they store data in a format that’s easy to use and understand. For example, we can represent a customer with a JSON document containing information about the customer, such as the customer’s name, address, and phone number. We can use this database for web applications that need to store data in a format that’s easy to use and understand. Non-relational databases are known as NoSQL databases.

Relational databases are better for storing data that we can organize in a well-defined way. They’re also better for running complex queries on large amounts of data. Non-relational databases are a good option for storing data that are not well-defined or for storing data in a format that’s easy to use and understand.

Both relational and non-relational databases have their advantages and disadvantages. It’s vital to choose the right type of database for your needs.

Need for non-relational databases

Non-relational databases, or NoSQL databases, store and manage large-scale data. They are especially useful for managing unstructured data, such as text or images. They can also be used to store data accessed frequently, such as user activity logs.

Non-relational databases are designed to handle large-scale data more efficiently than traditional relational databases. Companies with large datasets, such as social media networks and online retailers, often use them.

Popular non-relational databases

The most popular non-relational databases include MongoDB, Cassandra, and HBase. These databases are used by companies such as Facebook, Twitter, and LinkedIn. They offer features not available in traditional relational databases, such as the ability to handle large-scale data and the flexibility to add and remove data.

The list below mentions the different NoSQL database systems we can encounter:

  • Object/document database

  • Column store database (Hypertable)

  • Key-value pair store database

  • Graph database

  • Bigtable implementation (HBase)

  • Spatial database

  • Databases with the MapReduce programming model

  • Multi-model database system

Get hands-on with 1200+ tech skills courses.