09 Feb ‘Types of modern databases‘
Database types are templates and structures used to organize data in a database management system (DBMS). The choice of the type will affect what operations the application can perform, how the data is presented, the functions of the DBMS for development and runtime.
1. The simplest types of databases
-
Simple data structures
The first and simplest way to store data is text file. The method is still used today to work with small amounts of information. A special character is used to separate fields: comma or semicolon in CSV-files of datasets, colon or space in * nix-like systems.
Consequences:
-
the type and level of complexity of the stored information is limited;
-
it is difficult to establish connections between data components;
-
lack of concurrency features;
-
practical only for systems with low read and write requirements;
-
used to store configuration data;
-
no need for third-party software.
*Examples:
/ etc / passwd and / etc / fstab on * nix systems
csv files
-
Hierarchical databases
In contrast to text tables, in the next type of database, there are links between objects. In hierarchical databases, each record has one “parent”. This creates a tree structure in which records are classified according to their relationship with the parent record chain.
Consequences:
-
information is organized in a tree-like structure with parent-child relationships;
-
each record can have at most one parent;
-
links between records are made in the form of physical pointers;
-
it is impossible to implement a many-to-many relationship.
*Examples:
file systems
DNS
LDAP
-
Network databases
Networked databases extend the functionality of hierarchical databases: records can have more than one parent. This means you can model complex relationships.
Consequences:
-
network databases are represented not by a tree, but by a common graph
-
limited by the same access patterns as hierarchical databases
IDMS
2. Relational databases
SQL databases
Relational databases are the oldest type of general-purpose database still in widespread use. Data and links between data are organized using tables. Each column in a table has a name and type. Each row represents a separate record or data item in the table that contains values for each of the columns.
Consequences:
-
a field in a table called a foreign key can contain references to columns in other tables, which allows them to be joined;
-
highly organized structure and flexibility makes relational databases powerful and adaptable to various types of data;
-
structured query language (SQL) is used to access data;
-
a reliable choice for many applications.
**Examples:
MySQL
MariaDB
PostgreSQL
SQLite
3. Databases “key-value”
In key-value databases, to store information, you provide a key and a data object that you want to store. For example, JSON object, image, or text. To request data, you send a key and receive a blob.
Consequences:
-
storage facilities provide fast and low-cost access;
-
often store configuration data and information about the state of data represented by dictionaries or hashes;
-
there is no rigid scheme of the relationship between data, therefore, different types of data are often stored in such databases at the same time;
-
it is the developer’s responsibility to define the key naming scheme and to ensure that the value is of the appropriate type/format.
Examples:
Redis
memcached
etcd.