...

/

Types of Databases

Types of Databases

Introduction

In this lesson, we will discuss different types of databases used in designing a system. Moreover, this lesson will enable users to select a database suitable for their applications.

Primarily, databases are divided into two groups; Relational and Non-Relational databases. Non-relational databases are also called NoSQL databases, stands for Not-Only SQL.

There are various factors affecting the choice of database to be used in an application.

  1. The type of data

    The first factor affecting the choice of database is the type of data that needs to be stored. It may include the structured data, which follows some predefined structure, and the non-structured data.

    Structured data can fit into a pre-defined structure, like in tabular format organized by rows and columns. An example of structured data is employee data of an organization, where different attributes related to employees can be stored in tabular format.

    Unstructured data is complex and does not consist of any pre-defined shape; therefore, it is difficult to store in tabular format. An example would be imagery and video data, data collected through sensors, etc. Another kind of data is semi-structured, which does not have any rigid shape, but has some characteristics of structured data. An email can be considered as a good example of unstructured data, where some fields are pre-defined while the text/data can be of varying length.

  2. Query pattern

    Another factor affecting the database choice is the variety of queries. Some queries required lesser data while some require the bulk of data to be transferred to/from a database.

  3. The scale of the data

    Choice of the database also depends on the scale and amount of data that needs to be stored.

Relational databases

Relational databases adhere to particular schemas before storing the data. The data stored in relational databases has some prior structure. Mostly, this model organizes data into one or more relations, with a unique key for each tuple (instance). Each entity of the data consists of instances and attributes where instances are stored in rows and each column representing the attributes of each instance. Since each tuple has a unique key, therefore, a tuple in one table can be linked to another tuple in other tables by storing the primary keys in other tables generally known as foreign keys.

A Structure Query Language (SQL) is used for maintaining the database; insertion, deletion, and retrieval of data.

There are various reasons for the popularity and dominance of relational databases which include simplicity, robustness, flexibility, performance, scalabilityTraditional databases are vertically scalable., and compatibility in managing generic data. Such databases follow the Atomicity, Consistency, Isolation, and Durability (ACID) properties to maintain the integrity of the database, as explained below.

  • Atomicity: A transaction is considered an atomic unit. Hence, all the statements within a transaction will successfully execute, or none of them will execute. If a statement fails within a transaction; it should be aborted and rollback.

  • Consistency: At any given time the database should be in a consistent state, and it should remain in a consistent state after every transaction. For example, if multiple users want to view a record from the database it should return a similar result each time.

  • Isolation: In the case of multiple ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy