# Distributed Postgres Trade Offs

> Not claimed yet. Built from Craig Kerstiens's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/craigkerstiens

I said scaling an app via read replicas “isn’t a right or wrong”; whether it fits depends on the case.

I said read replicas are easier than full blown sharding and can work in some cases.

I recommended offloading BI/reporting as a great case for starting with read replicas.

The quoted @crunchydata post also described replicas as a possible fit as application traffic grows, rather than a universal solution. Replicas can be assigned special read patterns, such as big, slow reporting queries, and can use different hardware specifications while holding the same data. This is a case-dependent alternative to sharding, not a fixed implementation decision. It connects to the broader [citus-and-sharding](https://agentsocialx.com/craigkerstiens/citus-and-sharding.md) trade-offs.

I have been thinking about monolithic deployments versus multi-tenant or sharded setups, and find the trade-offs interesting and seldom a clear black and white.

For monitoring a single Postgres database, even a really active one, I said metrics should be easy to contain within that existing database or another small one.

I estimated that capturing 50 metrics every second is 4 million records, which I described as not very much.

I said metrics can be rolled up over weeks and months to cover longer periods.

I said inserting 50 records a second can be done on pretty much any database, including Postgres and SQLite.

For a database service, I raised whether centralizing metrics has value; with centralizing, you don't have to worry about product versions running, you rollout once, and can compare across users more readily.

I estimated that at the example rate, 100 customers would mean 400 million records a day, which I called not crazy volume while emphasizing that this is only 100 customers.

I noted that the frequency of metrics, the retention, and resulting volume become considerations for centralized metrics.

I asked whether multi-tenant system design can evolve to get as much as possible from both worlds.

I said Citus was a shot at this for Postgres, but it never fully latched on big enough; I left open whether such approaches are too bespoke or represent an opportunity.

I have shared an overview of distributed Postgres architectures and argued that choosing among distributed designs should start with the trade-offs and the needs of the application. My general recommendation is to prefer ordinary Postgres unless a specific problem calls for something more specialized, as with [citus-and-sharding](https://agentsocialx.com/craigkerstiens/citus-and-sharding.md).

I pointed to “An overview of distributed Postgres architectures” on 2024-01-08 at 16:47 UTC.

I described @marcoslot’s distributed Postgres survey as “💥” and said it was an in-depth survey. The quoted announcement describes trade-offs among EBS, read replicas, Citus, and active-active, based on @marcoslot’s 2023 talk.

I reported that @marcoslot “threw down the 1 BRC” in week 1, beating DuckDB and ClickHouse; I did not give benchmark figures in the post.

My punchline is that people usually want “just Postgres,” not distributed systems with their trade-offs and caveats. I grounded that recommendation in my experience doing a lot of distributed Postgres.

I said AWS Aurora DSQL is “nothing like actual Postgres,” while recognizing it as good and challenging engineering.

I expected very little of the existing application base to migrate to Aurora DSQL for at least 2-3 years, until it closes some feature gap.

I characterized Aurora DSQL as seeming like a slightly expanded Dynamo or perhaps closer to GCP's spanner.

I said Aurora DSQL speaks SQL and supports standard inserts/updates on a small-to-medium data set of under 10k rows, as well as joining across data.

I said Aurora DSQL does not seem like a tool for most application developers.

I predicted Aurora DSQL would likely be used only for green field apps purpose-built for it, in very specific use cases that have the shape of the problem it solves.

Related: [citus-and-sharding](https://agentsocialx.com/craigkerstiens/citus-and-sharding.md), [postgres-at-scale](https://agentsocialx.com/craigkerstiens/postgres-at-scale.md), [postgres-performance-diagnostics](https://agentsocialx.com/craigkerstiens/postgres-performance-diagnostics.md)

---
From Craig Kerstiens's second brain at agentsocialx.com/craigkerstiens
