Loading video...

Video Failed to Load

Go Home

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

E's profile picture
E1 year ago

I can do it even better:

Ben Dicken's profile picture
Ben Dicken1 year ago

Incredible.

Jorge Trujillo's profile picture
Jorge Trujillo1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

😂

Dimitris GR 900 Liverpol Fan Account's profile picture
Dimitris GR 900 Liverpol Fan Account1 year ago

People put them in different regions? For reals?

Ben Dicken's profile picture
Ben Dicken1 year ago

@Dimitris_Efsta Sometimes, yes.

Ronan Berder (SF + SG)'s profile picture
Ronan Berder (SF + SG)1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

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

Ronan Berder (SF + SG)'s profile picture
Ronan Berder (SF + SG)1 year ago

Litestream + R2 or S3

Ben Dicken's profile picture
Ben Dicken1 year ago

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?

Ronan Berder (SF + SG)'s profile picture
Ronan Berder (SF + SG)1 year ago

> 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.

Ben Dicken's profile picture
Ben Dicken1 year ago

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

Ronan Berder (SF + SG)'s profile picture
Ronan Berder (SF + SG)1 year ago

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

Radic Davydov's profile picture
Radic Davydov1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

Radic gets it.

nle's profile picture
nle1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

@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.

Ben Hollis's profile picture
Ben Hollis1 year ago

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

Oosta Soroosh's profile picture
Oosta Soroosh1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

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

Patrick Kuhnke's profile picture
Patrick Kuhnke1 year ago

What about not using a database at all?

Ben Dicken's profile picture
Ben Dicken1 year ago

@ku_ds17868 Interesting. Say more.

Patrick Kuhnke's profile picture
Patrick Kuhnke1 year ago

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.

Jonathan's profile picture
Jonathan1 year ago

People don’t do this????

Ben Dicken's profile picture
Ben Dicken1 year ago

Some don't!

Jonathan's profile picture
Jonathan1 year ago

Diabolical behavior

Jamie Turner's profile picture
Jamie Turner1 year ago

Are there people who don't do that?

Ben Dicken's profile picture
Ben Dicken1 year ago

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

Holly Guevara's profile picture
Holly Guevara1 year ago

He can't keep getting away with this

Ernesto Diaz's profile picture
Ernesto Diaz1 year ago

Care to explain this one?

Ben Dicken's profile picture
Ben Dicken1 year ago

Check out

𝒫𝑒𝓇 𝒜𝓇𝓃𝑒𝓃𝑔 【🐧λ🦀⎈】's profile picture
𝒫𝑒𝓇 𝒜𝓇𝓃𝑒𝓃𝑔 【🐧λ🦀⎈】1 year ago

Same availability zone even.

Ben Dicken's profile picture
Ben Dicken1 year ago

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.

Tyler F. Cloutier's profile picture
Tyler F. Cloutier1 year ago

I am once again asking you to put your database servers and application servers in the same process. @spacetimedb

PRIZ ;]'s profile picture
PRIZ ;]1 year ago

I am once again begging you to STOP USING SPEED BALLS

Marc Steele's profile picture
Marc Steele1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

@steelegbr 😅

Jamie Voynow's profile picture
Jamie Voynow1 year ago

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

AJ Stuyvenberg's profile picture
AJ Stuyvenberg1 year ago

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

NightinWolf's profile picture
NightinWolf1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

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

NightinWolf's profile picture
NightinWolf1 year ago

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.

Ben Dicken's profile picture
Ben Dicken1 year ago

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.

etkaute's profile picture
etkaute1 year ago

This graphic scratches an itch in my brain

Jackson's profile picture
Jackson1 year ago

cool visual, but pretty sure nobody is doing this

Ben Dicken's profile picture
Ben Dicken1 year ago

Unfortunately it does happen.

Agustin Falaz's profile picture
Agustin Falaz1 year ago

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

kortress's profile picture
kortress1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

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.

Jeferson's profile picture
Jeferson1 year ago

Edge computing can be a good strategy.

Ben Dicken's profile picture
Ben Dicken1 year ago

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.

Rajiv Khaneja's profile picture
Rajiv Khaneja1 year ago

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

network_pun's profile picture
network_pun1 year ago

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

lala's profile picture
lala1 year ago

Nice visual

Devaansh Bhandari's profile picture
Devaansh Bhandari1 year ago

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?

Alex Havryleshko's profile picture
Alex Havryleshko1 year ago

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.

Josh Stein's profile picture
Josh Stein1 year ago

where can I slide it all the way?

Scott | 1A x 2A 🇺🇲's profile picture
Scott | 1A x 2A 🇺🇲1 year ago

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

Ben Dicken's profile picture
Ben Dicken1 year ago

We've got this info on our pricing page:

Chase Miller's profile picture
Chase Miller1 year ago

The cost savings is huge too.

Jake Casto's profile picture
Jake Casto1 year ago

Explain Neon using balls

Related Videos