Loading video...
Video Failed to Load
I am once again begging you to put your database servers and application servers in the same region.
1,422,580 views • 1 year ago •via X (Twitter)
61 Comments

I can do it even better:

Incredible.

whoever did the us-east-1 ↔ ap-east-1 combo must already have the open to work picture

😂

People put them in different regions? For reals?

@Dimitris_Efsta Sometimes, yes.

Better yet: use SQLite and have the DB on the same server.

What happens when your one server goes down or has a failing disk?

Litestream + R2 or S3

That's cool. My two big questions are: (1) How can to commit writes with acceptable latency? (2) If a node goes down, how fast is a restore? Is one having to take downtime?

> How can to commit writes with acceptable latency? I use Litestream for backups. If you really want a more complex setup, Turso or D1 is your friend. > If a node goes down, how fast is a restore? Is one having to take downtime? It's a file, pretty fast. Faster than getting a new node set up and the code running. I wasn't taking a dig on Planetscale BTW, I only just realized you work there.

No need to apologize! I want to learn more about cool tech.

In that case, I'd check Limbo from the Turso folks: Sounds like a pretty cool attempt to rewrite SQLite.

They should be in the same data center with < 1ms latency.

Radic gets it.

Is there any reason to put them in different regions though? Naturally people just start out on a single region for a long time until they need to scale up multi regions, in that case they still keep db separated in each region

@oscarle_x There are cases where multi-region databases are needed for ultra-high durability cases, like financial transactions. I would not recommend having a multi-master setup though. Have one region replicate from the other.

What kind of criminal would NOT have their DB in the same region as the app servers!?

what's the difference between the first and the second one?

Intra-AZ vs inter-AZ. For further reading check this out:

What about not using a database at all?

@ku_ds17868 Interesting. Say more.

So the state of your application is stored in memory on the server and serialized to disk. You still need to make sure that the server is nearby though.

People don’t do this????

Some don't!

Diabolical behavior

Are there people who don't do that?

This tweet is to ensure we eliminate the few that do 🫡

He can't keep getting away with this

Care to explain this one?

Check out

Same availability zone even.

Absolutely! We shouldn't rely on same-AZ since we generally need to replicate across multiple AZs for high-availability, but this is certainly optimal.

I am once again asking you to put your database servers and application servers in the same process. @spacetimedb
![PRIZ ;]'s profile picture](https://image.24vids.com/tw/profile_images/2069536582202535936/OdzhxsC4_x96.jpg)
I am once again begging you to STOP USING SPEED BALLS

Load balancers in Australia, app servers in the US and database in Europe. Think I’ve got it. Thanks for the tip!

@steelegbr 😅

@levelsio wait but I thought python was the bottleneck not the database ? 🤣

You and these balls man, you can't keep getting away with this

anything below 100ms is a decent result. misleading video.

For a full website page load, sure. For for a single round-trip from application to database, 100ms is far too long.

you have extreme expectations which i admire as I see you are involved with planetscale. big ups for that. but no website gets such result. i clicked on your reply and according to firefox, it took 735ms. so by ur standards, twitter is taking way way toooo long.

Sure, but loading page on X easily requires 10, 20, or even 50+ queries for a single web page load. Every millisecond we can shave off each query adds up.

This graphic scratches an itch in my brain

cool visual, but pretty sure nobody is doing this

Unfortunately it does happen.

us-east-1 talking to ap-east-1 is a vibecoded TODO app or admin panel

As far as I know, if they are in different regions, extra fee exists.

Yeah, this is true even of cross-AZ traffic. My understanding is that AWS charges bandwidth fees for traffic that's not within the same AZ.

Edge computing can be a good strategy.

Edge is great for caching resources and such. You have to be careful about connecting to a centralized database from far-away edge nodes though.

For certain workloads put your database and application on the same server. I've seen 10x increase in requests/sec

why do we need to keep inventing pretty pictures to say "latency exists"?

Nice visual

I'm not very experienced with infrastructure, but don't companies keep servers in different locations to reduce latency and for failover backup? For example, if the US server goes down, can it connect to the CA one? How is failover usually handled?

It started concerning me recently actually. I didn’t understand latency. With each query, the request travels across the network. Good rule of thumb in system design: configure it for the same region, and ideally same availability zone.

where can I slide it all the way?

Does Planetscale have a presence in each of these AWS datacenters? How does the cost compare to RDS?

We've got this info on our pricing page:

The cost savings is huge too.

Explain Neon using balls




