Multi-ProcessShared BuffersWALMVCCTOASTCheckpointsPage CacheBackground Workers

Architecture & Internals

How PostgreSQL actually works under the hood — the process model, memory architecture, storage engine, and the WAL that makes durability possible.

45 min read9 sections
01

PostgreSQL's Origin & Philosophy

PostgreSQL traces back to 1986 at UC Berkeley. Michael Stonebraker's POSTGRES project (Post-Ingres) aimed to solve the limitations of the relational model by adding extensibility — custom types, operators, and access methods. The "object-relational" in PostgreSQL means you can define your own data types and teach the database how to index them.

The core philosophy: correctness first, performance second. PostgreSQL will never sacrifice data integrity for speed. This is why it's the default choice when you need to trust your data — financial systems, healthcare, anything where "" isn't acceptable.

🏛️

The Bank Vault vs The Cash Register

MySQL is like a fast cash register — optimized for quick transactions, sometimes at the cost of strict guarantees. PostgreSQL is like a bank vault — every operation is verified, every constraint enforced, every transaction truly atomic. You pay slightly more in overhead, but you never lose money to a race condition.

The 'Just Use Postgres' Default

For most new systems, PostgreSQL is the correct starting database. It handles OLTP, has decent full-text search, supports JSON documents via , does geospatial with , and scales reads via streaming replication. You only need a specialized database when PostgreSQL demonstrably cannot handle your specific access pattern at your specific scale.

When PostgreSQL is the Wrong Choice

When PostgreSQL is the Wrong Choice

  • Extreme write throughput (millions/sec) — Cassandra or ScyllaDB territory
  • Simple key-value at massive scale with single-digit ms — DynamoDB territory
  • Full-text search as the primary feature at huge scale — Elasticsearch territory
  • Time-series with billions of data points — TimescaleDB extension or InfluxDB
  • Graph traversal as the primary query pattern — Neo4j or Neptune
1 / 9