Database System Concepts and Architecture


Modern information management rely heavily on database systems because they make it possible to store, retrieve, and manipulate massive volumes of data effectively. Designing reliable and scalable databases requires a thorough understanding of the principles and architecture of database systems. The essential ideas and complexities of database systems will be covered in detail in this article, along with examples from everyday life to show how they might be used in real-world situations.

Concepts of Database Systems

  • Data − Data is the central component of every database system. The information that has to be handled and saved is represented by data. It could be structured, somewhat structured, or not at all. Structured data is arranged into tables with rows and columns according to a predetermined pattern. Examples include financial data, product specifications, and client information. Data that is semi-structured, like JSON or XML, has some structure but does not follow a strict standard. Text documents, photos, and multimedia files are examples of unstructured data since they don't have a predetermined structure.

  • Database Management System (DBMS)−  Software that makes it easier to create, organize, and manipulate databases is known as a database management system (DBMS). It offers a selection of tools and user interfaces for effective data management. Data storage, data retrieval, data manipulation, data security, and concurrency control are among a DBMS's essential features. Popular DBMS s include PostgreSQL, Oracle, MySQL, and Microsoft SQL Server.

  • Database − A database is a structured collection of data that is maintained and organized by a database management system (DBMS). It is made up of one or more tables, each of which represents a different entity or idea. Each row in a table represents one instance of the entity, and each column in a table represents a particular quality or trait. Rows and columns make up a table.

  • Schema − A database schema outlines the logical organization and structure of a database. The tables, connections between tables, restrictions, and other information are all described. A schema outlines the structure and storage requirements for the data. Let's look at an illustration.

    Assume we have an online storefront with the following tables −

    Customers (Customer Id, Name, Email)

    Orders (Order Id, Customer Id, Order Date, Total Amount)

    Products (Product Id, Name, Price)

    The tables, their columns, and any connections or restrictions between them would all be specified by the schema.

  • Query Language − : A query language enables users to access, manage, and alter data from databases by sending queries. The most used query language for relational databases is Structured Query Language (SQL). For building, editing, and querying databases, it offers a set of commands and syntax.

Take the following SQL query, for instance −

SELECT Customers.Name, Orders.OrderDate, Orders.TotalAmount
FROM Customers
JOIN Orders ON Customers.CustomerId = Orders.CustomerId
WHERE Customers.Country = 'USA'

Input Table- Customers

CustomerId | Name          | Country
------------------------------------
1          | John Doe      | USA
2          | Jane Smith    | USA
3          | Mark Johnson  | Canada
4          | Sarah Wilson  | USA
5          | Robert Brown  | USA
6          | Lisa Thompson | Canada
7          | James Lee     | USA
8          | Emily Davis   | USA
9          | Michael Clark | Canada
10         | Emma Harris   | USA

Input Table- Orders

OrderId | CustomerId | OrderDate  | TotalAmount
-----------------------------------------------
1       | 1          | 2023-05-01 | $100.00
2       | 2          | 2023-05-10 | $250.00
3       | 2          | 2023-05-15 | $180.00
4       | 3          | 2023-05-20 | $300.00
5       | 4          | 2023-05-05 | $150.00
6       | 4          | 2023-05-12 | $220.00
7       | 5          | 2023-05-03 | $180.00
8       | 5          | 2023-05-18 | $280.00
9       | 7          | 2023-05-07 | $120.00
10      | 8          | 2023-05-09 | $200.00
11      | 8          | 2023-05-22 | $350.00
12      | 10         | 2023-05-14 | $190.00

Output Table

Customers.Name | Orders.OrderDate | Orders.TotalAmount
------------------------------------------------------
John Doe       | 2023-05-01       | $100.00
Jane Smith     | 2023-05-10       | $250.00
Jane Smith     | 2023-05-15       | $180.00
Sarah Wilson   | 2023-05-05       | $150.00
Sarah Wilson   | 2023-05-12       | $220.00
Robert Brown   | 2023-05-03       | $180.00
Robert Brown   | 2023-05-18       | $280.00
James Lee      | 2023-05-07       | $120.00
Emily Davis    | 2023-05-09       | $200.00
Emily Davis    | 2023-05-22       | $350.00
Emma Harris    | 2023-05-14       | $190.00

For all orders placed by clients in the USA, this query returns the customer name, order date, and order total.

For all orders placed by clients in the USA, this query returns the customer name, order date, and order total.

Database System Architecture

The general structure and parts of a database system are described by the database system architecture. It includes the following essential elements −

  • User Interface − Users can communicate with the database system using the user interface. It could take the form of a web-based interface, a GUI, or a command-line interface. Users may submit queries, enter data, and see query results or reports via the user interface.

    A web-based e-commerce program, for instance, may offer a user interface that enables users to look for items, make orders, and check their order histories.

  • Query Processor − The query processor executes and optimizes SQL queries after receiving them from users or applications. In order to get the required data and carry out any necessary activities, it analyses the query, chooses the most effective execution plan and communicates with other components. In order to reduce resource consumption and boost speed, the query processor makes sure that queries are processed as effectively as possible.

Take the prior SQL query, for instance −

SELECT Customers.Name, Orders.OrderDate, Orders.TotalAmount
FROM Customers
JOIN Orders ON Customers.CustomerId = Orders.CustomerId
WHERE Customers.Country = 'USA'

Input Table- Customers

CustomerId | Name          | Country
------------------------------------
1          | Adam Johnson  | USA
2          | Emma Thompson | UK
3          | Sophia Lee    | Canada
4          | Oliver Smith  | Australia
5          | Mia Davis     | USA
6          | Ethan Wilson  | UK
7          | Ava Brown     | Canada
8          | Noah Taylor   | Australia
9          | Isabella Chen | USA
10         | Liam Hall     | UK

Input Table- Orders

OrderId | CustomerId | OrderDate  | TotalAmount
-----------------------------------------------
1       | 1          | 2023-06-01 | $150.00
2       | 2          | 2023-06-05 | $200.00
3       | 3          | 2023-06-10 | $120.00
4       | 4          | 2023-06-15 | $250.00
5       | 5          | 2023-06-20 | $180.00
6       | 6          | 2023-06-25 | $300.00
7       | 7          | 2023-06-02 | $210.00
8       | 8          | 2023-06-07 | $160.00
9       | 9          | 2023-06-12 | $190.00
10      | 10         | 2023-06-18 | $230.00

Output Table

Customers.Name  | Orders.OrderDate | Orders.TotalAmount
------------------------------------------------------
Adam Johnson    | 2023-06-01       | $150.00
Emma Thompson   | 2023-06-05       | $200.00
Sophia Lee      | 2023-06-10       | $120.00
Oliver Smith    | 2023-06-15       | $250.00
Mia Davis       | 2023-06-20       | $180.00
Ethan Wilson    | 2023-06-25       | $300.00
Ava Brown       | 2023-06-02       | $210.00
Noah Taylor     | 2023-06-07       | $160.00
Isabella Chen   | 2023-06-12       | $190.00
Liam Hall       | 2023-06-18       | $230.00

The "Customers" and "Orders" tables' necessary data is efficiently retrieved by the query processor, which also analyses the query and chooses the best join technique.

  • Storage Manager − Managing the actual physical storage of data on discs or other storage media is the responsibility of the storage manager. To read and write data, it communicates with the file system or storage subsystem. To facilitate data access and guarantee data integrity, the storage manager manages data archiving, retrieval, and indexin

    For instance, the storage manager oversees the allocation of disc space to guarantee effective storage when a new order is placed in the e-commerce application. It also saves the order details in the relevant tables.

  • Buffer Manager − Data transfer between memory and disc storage is controlled by the buffer manager, an important component. It reduces disc I/O operations and boosts efficiency by using a buffer cache to keep frequently used data pages in memory. The buffer manager makes sure that data caching and replacement procedures are effective in order to maximize memory consumption.

    For instance, when a query is run that needs to access data from the disc, the buffer manager pulls the necessary data pages into the buffer cache from the disc. The need for disc access can be avoided by serving subsequent requests that access the same data from memory.

  • Transactions Manager − Database transactions' atomicity, consistency, isolation, and durability are all guaranteed by the transaction manager. To maintain data integrity and concurrency management, it maintains concurrent access to the data, takes care of transaction execution, and enforces transaction isolation levels.

    For instance, the transaction manager makes sure that each order is executed as a separate transaction when several clients place orders at once, ensuring data integrity and avoiding conflicts.

  • Data Dictionary − The metadata regarding the database schema and objects are stored in the data dictionary, sometimes referred to as the metadata repository. It includes details on various database structures, including tables, columns, data types, constraints, indexes, and more. The DBMS uses the data dictionary to verify queries, uphold data integrity, and offer details on the database structure

    For instance, the data dictionary keeps tabs on the names, columns, data types, and constraints of the tables in the e-commerce application.

  • Concurrency Control − Multiple transactions can access and edit the database simultaneously without resulting in inconsistent data thanks to concurrency control methods. To regulate concurrent access and preserve data integrity, methods including locking, timestamp ordering, and multi-version concurrency control (MVCC) are utilized.

    Concurrency control measures, for instance, make sure that two consumers updating their profiles in the same e-commerce application at the same time are serialized and applied appropriately to maintain data consistency.

  • Backup and recovery − In order to safeguard against data loss and guarantee data availability, database systems must have backup and recovery processes. In the case of system failures or data corruption, recovery procedures are employed to restore the database to a consistent condition. Regular backups are performed to create copies of the database.

    To guarantee that data can be restored in the event of hardware problems or unintentional data loss, for instance, frequent backups of the e-commerce database are made.

Conclusion

In conclusion, building, implementing, and maintaining reliable and scalable databases requires an understanding of the principles and architecture of database systems. We looked at the essential ideas of data, DBMS, database, schema, and query language in this post. The architecture of database systems was also covered in detail, with topics covered including the user interface, query processor, storage manager, buffer manager, transaction manager, data dictionary, concurrency management, and backup and recovery procedures.

Updated on: 02-Aug-2023

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements