News for hackers. Stuff that matters.
Re:The economics of a Postgres free tier by danpalmer on Thursday July 11, 2024 @07:27PM (#40941533)
Something I'd love to understand is the latency model for hosted databases like this. Every production web app or backend I've worked on has pretty much depended on having 1-3ms latency to the database. That's easy when you're deploying your own hardware, and in my experience easy when you use a cloud provider's hosted offering in the same zone, and fine within the region.

So how does this work? I sign up and get a Postgres connection string. Where is it? Because the where _really_ matters. Do Xata and the other examples of this all deploy into all the cloud providers and all the regions and let you choose which one? That feels like a big duplication of effort and like it would be harder to get critical mass in order to get the unit economics to work. Or do people just put up with a database 10ms away?

Re:The economics of a Postgres free tier by skybrian on Thursday July 11, 2024 @08:04PM (#40941705)
They let you choose a region. Here is Xata’s region list:

https://xata.io/docs/getting-started/available-regions

But also, they’ve done some work to reduce the number of network round trips that Postgres needs to respond to a query. For many situations, SQL over HTTPS is used. In JavaScript, the database driver is a wrapper around a fetch request.

Here’s Neon’s blog post on their connection options:

https://neon.tech/blog/http-vs-websockets-for-postgres-queri...

Xata seems to have its own SDK with higher-level API’s to reduce round trips.

Re:The economics of a Postgres free tier by scosman on Thursday July 11, 2024 @07:35PM (#40941565)
Every one I’ve used is on AWS and will tell you the zone so you can keep things within the region/zone. That includes Heroku, Supabase, Neon, and (obviously) RDS.

That said, I’ve used AWS DBs with Cloudflare pages and the latency isn’t a major issue. If you are running non geo-distributed DB, the DB is a lot further than 10ms away from your average user.

Re:The economics of a Postgres free tier by danpalmer on Thursday July 11, 2024 @07:56PM (#40941668)
In my experience, applications tend to do far more DB queries than users do backend requests, and as such, 50ms to the user matters much less than the difference between 1 and 10ms on DB queries.

That said, thanks for the experience. Do they also tend to launch in other cloud providers? It seems like it would be a tricky business to navigate, restricting your customer base to specific providers.

Re:The economics of a Postgres free tier by Kwpolska on Thursday July 11, 2024 @07:41PM (#40941593)
Some SaaS providers will let you choose your cloud and set up their services there.

As for the latency, it might not matter for all applications, or it may encourage the devs to spend more time optimizing the number of SQL queries.