Essential session storage is required to sign in. Optional analytics remain off unless you allow them.
Stand up a production-shaped PostgreSQL deployment. Include: (1) a PRIMARY with at least one streaming REPLICA, and demonstrate failover/promotion (manually or with Patroni/repmgr) plus the async-vs-sync trade-off; (2) a connection POOLER (PgBouncer) in transaction mode, with the pool sized against max_connections and RAM, and awareness of what transaction pooling breaks; (3) MONITORING via pg_stat_* views and/or a Prometheus exporter covering connections, cache hit ratio, replication lag, locks, and bloat, with alert thresholds; (4) tuned autovacuum and a wraparound check; and (5) a security baseline (least-privilege roles, scram-sha-256, TLS, optionally RLS). Write runbooks for backup verification and failover, and load-test it.
Working streaming replication; failover/promotion demonstrated; async vs sync trade-off and replica lag understood; replication != backup.
PgBouncer configured with a justified pool size; transaction-mode trade-offs understood; avoids the connection-exhaustion failure mode.
Meaningful metrics + alert thresholds (lag, cache hit, locks, bloat); autovacuum tuned; xid-wraparound guarded.
Least-privilege roles, scram-sha-256, TLS; backup-verify and failover runbooks; load-tested.
Use this README structure to make the work reviewable.
DevPath fetches a read-only, size-capped snapshot. Submitted code is never executed.
# A replicated, monitored, production-shaped cluster ## Goal Stand up a production-shaped PostgreSQL deployment. Include: (1) a PRIMARY with at least one streaming REPLICA, and demonstrate failover/promotion (manually or with Patroni/repmgr) plus the async-vs-sync trade-off; (2) a connection POOLER (PgBouncer) in transaction mode, with the pool sized against max_connections and RAM, and awareness of what transaction pooling breaks; (3) MONITORING via pg_stat_* views and/or a Prometheus exporter covering connections, cache hit ratio, replication lag, locks, and bloat, with alert thresholds; (4) tuned autovacuum and a wraparound check; and (5) a security baseline (least-privilege roles, scram-sha-256, TLS, optionally RLS). Write runbooks for backup verification and failover, and load-test it. ## Acceptance criteria - [ ] Replication & HA: Working streaming replication; failover/promotion demonstrated; async vs sync trade-off and replica lag understood; replication != backup. - [ ] Pooling & connections: PgBouncer configured with a justified pool size; transaction-mode trade-offs understood; avoids the connection-exhaustion failure mode. - [ ] Monitoring & maintenance: Meaningful metrics + alert thresholds (lag, cache hit, locks, bloat); autovacuum tuned; xid-wraparound guarded. - [ ] Security & runbooks: Least-privilege roles, scram-sha-256, TLS; backup-verify and failover runbooks; load-tested. ## Verification - [ ] Document installation and run commands. - [ ] Record automated checks and their exact commands. - [ ] Add representative output, screenshots, or a short demo where useful. - [ ] Confirm failure paths and known constraints. ## Decision log ### Decision title - Context: - Choice: - Alternatives considered: - Tradeoffs: ## Evidence - Link each rubric criterion to the file, test, or artifact that demonstrates it. ## Known limitations - List what is intentionally out of scope and what should be improved next.