Get the latest tech news
How to Distribute Postgres Geographically
Documenting a pattern for making multi-tenant applications global by distributing the data, using only standard PostgreSQL functionality.
If you'd like to use something like Cloudflare workers but also want to use Postgres, you'd better have some distributed data strategy, or you'll end up paying a lot of latency costs, especially if your app needs multiple round trips to the database. As we've seen, this pattern works great as long as you don't need to access or write to multiple tenants at the same time too often, which is typically the case for multi-tenant SaaS applications. Over the longer term, as the Postgres FDW, partitioning, and planner improve, we can expect the global views to be more performant and that will make this pattern useful for a wider range of applications.
Or read this on Hacker News