N
Neon2y ago
stormy-gold

why Neon Postgres is 30x slower than Supabase Postgres in Vercel Edge functions?

Vercel Edge Functions + Database Latency
Observe the latency querying different data services from varying compute locations.
No description
No description
10 Replies
stormy-gold
stormy-goldOP2y ago
If both services are using Postgres then how Supabase is so much faster than Neon?
quickest-silver
quickest-silver2y ago
That's odd. Maybe it depends on the region you're in? My results are wildly different. I'm on the US West Coast:
No description
No description
quickest-silver
quickest-silver2y ago
Are you able to consistently produce your result?
stuck-chocolate
stuck-chocolate2y ago
I think it's because you're using global functions. Regional function latencies should be much lower. Global functions means that the edge function will run closer to your location. If you're not in the US East coast (where the database is) you will experience lower latencies. I'm not entirely familiar with Supabase, but It's possible they use global replicas to lower those latencies.
stuck-chocolate
stuck-chocolate2y ago
This is what I'm getting with regional functions.
No description
No description
stormy-gold
stormy-goldOP2y ago
I'm testing from Thailand and yes results are consistent i get the idea that neon db is in US so the latency is expected. i might need to check with supabase how they achieved lower
stuck-chocolate
stuck-chocolate2y ago
Cool. Let us know.
stormy-gold
stormy-goldOP2y ago
GitHub
Supabase result is misleading (data returned is null from db) · Iss...
When testing from Asia (Thailand) Supabase gave 100ms latency for global edge function and it seems too good to be true (afaik supabase db is in the US). Upon debugging, I discovered the data retur...
stuck-chocolate
stuck-chocolate2y ago
Interesting. Thanks for sharing.
inland-turquoise
inland-turquoise2y ago
YouTube
✂️ MongoDB writes to /dev/null
51 seconds · Clipped by Noé Pion · Original video "F2023 #25 - Potpourri: Redis, CockroachDB, Snowflake, MangoDB, TabDB (CMU Intro to Database Systems)" by C...

Did you find this page helpful?