Give your stateless app one place that remembers.
In this interactive Infrastructure lesson from Stencel Academy you don't just read — you type real commands like psql -h db-01 -c "SELECT email FROM users LIMIT 3;", psql -h db-01 -c "UPDATE users SET plan='pro' WHERE id=42;" and watch the machine respond on a live, animated map. It is part of the free How Infrastructure Works course.
Builds on: Web Servers & Reverse Proxies.
psql -h db-02 -c "SELECT pg_is_in_recovery();" — Ask db-02 what it is: t = replica.psql -h db-02 -c "UPDATE users SET plan='pro' WHERE id=42;" — Writes to a replica fail — one writer keeps one truth.psql -h db-01 -c "SELECT client_addr, state FROM pg_stat_replication;" — The primary knows who is following it.pg_dump -h db-01 promptd | head -5 — A backup is the state, serialized — replicas are not backups.