Architecture


PostgreSQL employs a standard client/server architecture, whereby the database server accepts connections from a client in a local or remote fashion. If the client and server are installed on the same host, a first-in, first-out (FIFO) buffer is used for communication. If the client and server are installed on different hosts, the two communicate over a TCP/IP network connection. Once a connection is made, the PostgreSQL internals take over.

Let’s take a brief look at the PostgreSQL architecture shown in Figure 13-1. This information is intentionally high-level to convey the general meaning without diving too deep. Connections coming into the server begin at the top of the diagram with Main. Main passes control to either the Postmaster or directly to the Postgres engine(s). The Postmaster controls the PostgreSQL startup and shutdown. To handle concurrency, the Postmaster forks a new process for each new connection that arrives. Postgres is the database engine and handles all calls to the various internals, including the Parser, the Optimizer, and the Executor. The Parser is a query parser that breaks a SQL query down into a tree of nodes. The Optimizer creates an optimal plan for the Executor. The Executor executes the plan of nodes for Create Read, Update, and Delete (CRUD) statements. Beneath the Executor are the Storage Managers, SQL Query Nodes, the Catalog, and Data Access modules. These items handle all the access to the data in memory and on disk.

image from book
Figure 13-1: PostgreSQL architecture

As for security, PostgreSQL is fairly locked down in the sense that remote connections are not available by default. To allow remote connections, a special configuration is required on the server side (the pg_hba.conf file) and the server must be started up with the -i flag to allow for remote, TCP/IP connections. Now that the brief overview of the PostgreSQL architecture is complete, the next concern is getting PostgreSQL up and running.




Professional Apache Geronimo
Professional Apache Geronimo (Wrox Professional Guides)
ISBN: 0471785431
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net