Databases
Replication lag
The delay between a write committing on the primary and becoming visible on a replica.
Lag turns a read replica into a source of stale answers, and read-after-write breaks in ways that look like application bugs. Bounding it is a design decision: synchronous replication removes the staleness and adds a latency cost and a new availability failure mode.
Explained in depth
PostgreSQL
PostgreSQL internals that decide production behaviour - MVCC and XID wraparound, autovacuum thresholds, work_mem, WAL durability, indexes, replication.
PatroniHow Patroni fails PostgreSQL over - the DCS leader lock, the ttl/loop_wait/retry_timeout rule, watchdog fencing, and a runnable three-node config.