Cobra Forum

Plesk Panel => Web Application => Topic started by: Administrator on Dec 31, 2022, 05:43 AM

Title: NoSQL Databases Explained
Post by: Administrator on Dec 31, 2022, 05:43 AM
Introduction
The Relational Database Management Systems (RDBMS) model dates to the 1970s. Over the years, the model of the RDBMS has conveniently allowed developers to store data in a collection of rows, columns, and tables. Apart from information storage, RDBMS are secure, convenient, and affordable. However, the RDBMS architecture has the following limitations:

Schema rigidity: After defining a schema in RDBMS, you can't add new columns on the fly without affecting the entire table. Modern-day information systems require the ability to store structured, semi-structured, and unstructured data.

Structural limitations: The hard limits for field lengths, columns per table, and row size in traditional databases don't match the modern-day IT needs.

Poor interoperability: Most RDBMS applications require special integration libraries or drivers. For faster integration, developers prefer database systems with inbuilt HTTP Application Programming Interface (API) and modern data access layers.

Scalability issues: The RDBMS model dates back when data was small, orderly, and neat. Modern-day massive data slows down the RDBMS applications.

Poor performance with distributed applications. The architecture of RDBMS performs poorly with distributed online databases. The design of Most RDBMS applications worked well with one computer before the birth of the internet.

1. Types of NoSQL Databases

Four main types of NoSQL databases exist:

Key-value databases.

Document databases.

Graph databases.

Wide-column databases.

1.1. Key-value Databases

Key-value databases use an associative array model to write and read data. Associative arrays use unique identifiers (keys) to set a value. Key-value stores are also known as maps or dictionaries in different programming languages. The following is a sample of session data access tokens stored in a key-value database:

    +------------+-----------------------------------+
    |    key     |             value                 |
    +------------+-----------------------------------+
    |user_100731 | 8527f5ecd4f311ec9d640242ac120002  |
    |user_100732 | 8527f7ccd4f311ec9d640242ac120002  |
    |user_100733 | 8527f8d0d4f311ec9d640242ac120002  |
    |user_100734 | 8527f9b6d4f311ec9d640242ac120002  |
    +------------+-----------------------------------+
The key-value databases support the following data types:

strings

Lists

Geospatial indexes

Sets

Hashes

The Key-value databases use an effective partitioning model that supports horizontal scaling better than any other type of database. This support for massive scalability is suitable for applications where end-users interact simultaneously with the system.

Use-cases for key-value databases:

Session management: When users log in to a system, an application generates session data like an access token, profile information, preferred themes, and recommendations. The application must rapidly fetch the session data in real-time. An in-memory key-value database uses a key to store each user's data.

Shopping cart management: Some websites receive millions of orders during peak seasons. Distributed key-value databases use vertical and horizontal scaling to handle massive data from millions of users.

Caching: A cache is a high-speed data storage for regularly accessed data like combo box values, products' catalogs, and more. The key-value databases use the computer's RAM as a cache to speed up program execution.

Popular open-source key-value databases:

Redis server.

Memcached server.
Title: Re: NoSQL Databases Explained
Post by: Administrator on Jan 06, 2023, 11:53 AM

Introduction
The Relational Database Management Systems (RDBMS) model dates to the 1970s. Over the years, the model of the RDBMS has conveniently allowed developers to store data in a collection of rows, columns, and tables. Apart from information storage, RDBMS are secure, convenient, and affordable. However, the RDBMS architecture has the following limitations:

Schema rigidity: After defining a schema in RDBMS, you can't add new columns on the fly without affecting the entire table. Modern-day information systems require the ability to store structured, semi-structured, and unstructured data.

Structural limitations: The hard limits for field lengths, columns per table, and row size in traditional databases don't match the modern-day IT needs.

Poor interoperability: Most RDBMS applications require special integration libraries or drivers. For faster integration, developers prefer database systems with inbuilt HTTP Application Programming Interface (API) and modern data access layers.

Scalability issues: The RDBMS model dates back when data was small, orderly, and neat. Modern-day massive data slows down the RDBMS applications.

Poor performance with distributed applications. The architecture of RDBMS performs poorly with distributed online databases. The design of Most RDBMS applications worked well with one computer before the birth of the internet.

1. Types of NoSQL Databases

Four main types of NoSQL databases exist:

Key-value databases.

Document databases.

Graph databases.

Wide-column databases.

1.1. Key-value Databases

Key-value databases use an associative array model to write and read data. Associative arrays use unique identifiers (keys) to set a value. Key-value stores are also known as maps or dictionaries in different programming languages. The following is a sample of session data access tokens stored in a key-value database:

   
+------------+-----------------------------------+
    |    key    |            value                |
    +------------+-----------------------------------+
    |user_100731 | 8527f5ecd4f311ec9d640242ac120002  |
    |user_100732 | 8527f7ccd4f311ec9d640242ac120002  |
    |user_100733 | 8527f8d0d4f311ec9d640242ac120002  |
    |user_100734 | 8527f9b6d4f311ec9d640242ac120002  |
    +------------+-----------------------------------+
The key-value databases support the following data types:

strings

Lists

Geospatial indexes

Sets

Hashes

The Key-value databases use an effective partitioning model that supports horizontal scaling better than any other type of database. This support for massive scalability is suitable for applications where end-users interact simultaneously with the system.

Use-cases for key-value databases:

Session management: When users log in to a system, an application generates session data like an access token, profile information, preferred themes, and recommendations. The application must rapidly fetch the session data in real-time. An in-memory key-value database uses a key to store each user's data.

Shopping cart management: Some websites receive millions of orders during peak seasons. Distributed key-value databases use vertical and horizontal scaling to handle massive data from millions of users.

Caching: A cache is a high-speed data storage for regularly accessed data like combo box values, products' catalogs, and more. The key-value databases use the computer's RAM as a cache to speed up program execution.

Popular open-source key-value databases:

Redis server.

Memcached server.