NetBox ↔ PostgreSQL Read‑Only Replica: Offloading Reads for Low‑Traffic Workloads
0 reputation · 11 May 2022, 02:57 UTC
The goal is to determine whether NetBox can automatically direct read‑only SQL traffic to a PostgreSQL replica without requiring administrators to define a custom database router, thereby lowering hardware or managed‑service costs for low‑traffic deployments.
NetBox documentation shows that a read‑only replica can be used, but it requires setting DATABASES with a READ_REPLICA_URL and enabling DATABASE_ROUTERS, leaving it unclear if the framework supplies a built‑in router for this pattern. Concerns include replication lag causing stale UI data and the operational overhead of maintaining a replica, which may offset savings in very small environments. Does NetBox provide a built‑in database router that routes SELECT queries to a read‑only replica, or must a custom router be implemented? What performance impact does a custom router have compared with native connection pooling? How much replication lag is acceptable before UI inconsistency becomes a concern for change‑management workflows?