Local Postgres outperforms managed cloud instance by up to 7x in direct benchmark
A developer ran identical Postgres 17.11 databases — one local on a DigitalOcean droplet, one on DigitalOcean's smallest managed instance — to compare performance under controlled conditions using the same schema, 200,000 rows, and the same region. Initial application-level benchmarks via FastAPI appeared to show similar throughput across both setups, but further analysis revealed the Python runtime, not the database, was the actual bottleneck. Switching to pgbench for direct database testing exposed a stark difference: the local instance delivered up to seven times higher read throughput and roughly twice the write throughput compared to the managed option. The managed service's lower performance is attributed to network latency and shared resources, while the local database benefits from zero-latency same-machine access. The findings highlight that application-layer benchmarks can be misleading and that the right testing tool matters when evaluating database infrastructure choices.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in