The basic architecture of the PostgreSQL system

Source: Internet
Author: User

PostgreSQL provides services using the client/server (c/s) mode, where a PostgreSQL session consists of the following related processes (Programs):

(1) A server-side process. The process manages the database files, accepts the client's connection to the database, and operates on behalf of the client on the database. The program name of the process is called Postgres.

(2) Front-end applications, which are client applications that require database operations. Client applications may be a variety of themselves: they can be a tool for a character interface, an application of a graphical interface, a Web server that displays Web pages by accessing a database, or a special database management tool. Some client applications are provided with the PostgreSQL release, but most are user-developed.

As with typical client/server applications (c/S applications), clients and servers can be on different hosts. At this point, they are networked through TCP/IP, and you should keep this in mind, because files that are accessible on the client computer may not be accessible on the database server machine (or can only be accessed with a different file name).

The PostgreSQL server can handle multiple concurrent requests from the client. To be able to do this, it will start a new process for each request ("forks"), and then the client and the new server-side process will no longer communicate directly through the initial Postgres process. As a result, the main process on the server side is running, waiting for a connection from the client, while the client and the associated server-side processes run when needed. (Of course, these are transparent to the user, and this is mainly for the sake of explaining the completeness.) )

PostgreSQL database is a kind of free open source Object relational database which can run on various platforms, it is a kind of database which is based on relational database and SQL, and extends abstract data type to have object-oriented characteristic.

                        

PostgreSQL architecture Diagrams (composition structure and relationships)

PostgreSQL consists of five parts: the Connection Management System (System Controller), the compiling execution system, the storage management system, the transaction system and the system table.

The connection management system accepts the request of the external operation to the system, preprocessing and distributing the operation request, and plays the logical control function of the system.

Compiled execution system consists of query compiler, query executor, complete the processing and transformation of operation request in database, and finally realize the operation of data in physical storage media;

The storage management system consists of index manager, memory manager, external memory manager, which is responsible for storing and managing physical data and providing support for compiling query system;

Transaction system consists of transaction manager, log Manager, concurrency control, lock manager, log Manager and transaction manager to complete the transaction consistency support for operation request, lock Manager and concurrency control provide consistent support for concurrent access data;

system table is the meta-Information Management center of PostgreSQL database, including database object information and database management control information. The system table manages the metadata information, which connects each module of PostgreSQL database organically to form an efficient data management system.

system tables

In the relational database, in order to realize the control of the database system, the function of the data dictionary must be provided. The data dictionary stores not only the descriptive information of various objects, but also the details of the various objects required for the management of the system. The data dictionary contains the description information of all objects and their attributes in the database system, the description information of the relationship between objects, the natural language meanings of the object attributes and the history of the Data dictionary change, and the data dictionary is the core of the management control information of the relational database system. In the PostgreSQL database system, the system table plays the role of the data dictionary.

The system table is the place where the PostgreSQL database holds the structure metadata, and he is represented in PostgreSQL as a normal table or view that holds system information (the user can delete, rebuild).

The system table holds all the metadata for the database, so the system is running with very frequent access to the system tables. In order to improve the performance of the system, a shared system table is built in memory, and a hash table is used to improve the query efficiency.

Main system table functions

1 Pg_namespace Storage namespaces

2 Pg_tablespace Storage space information

3 Pg_database stores information about databases in the current dataset cluster.

4 Pg_class Storage tables and database object information, including, indexes, sequences, views, composite data types, toast tables, and similar structure to the table.

5 Pg_type stores data type information.

6 Pg_attribute Stores the property information for the table.

7 Pg_index Store The specific information for the index.

Dependencies between critical system tables: not listed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.