why Neon Postgres is 30x slower than Supabase Postgres in Vercel Edge functions?
I tested using https://edge-data-latency.vercel.app/
Vercel Edge Functions + Database Latency
Observe the latency querying different data services from varying compute locations.


10 Replies
stormy-goldOP•2y ago
If both services are using Postgres then how Supabase is so much faster than Neon?
quickest-silver•2y 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:


quickest-silver•2y ago
Are you able to consistently produce your result?
stuck-chocolate•2y 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•2y ago
This is what I'm getting with regional functions.


stormy-goldOP•2y 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•2y ago
Cool. Let us know.
stormy-goldOP•2y 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•2y ago
Interesting. Thanks for sharing.
inland-turquoise•2y ago
Reminding me of the infamous mongoDB to /dev/null https://youtube.com/clip/UgkxvvwsoOb6sNzBJKPFTzP84MEo1tnzBJ5j?si=-oLGI8tSwavMMFGJ
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...