In an effort to understand Postgres better I’ve worked my way through how a Postgres database is structured and executes queries.
Process Model
Postgres uses a process-per-worker model. That means every connection is handled by a separate operating system process forked off the initial process.
Subsystem Overview
Postgres consists of several components that all work together to process data and ensure it’s reliably written and can be looked up efficiently. The following are the most important components, but there more, other components that are beyond the scope of this post.