Hi all! After 2 weeks of hard work I'm almost done migrating from Supabase to Neon and overall the experience has been FANTASTIC I'm completely in love with Neon! But I have one annoying issue...
Please bear in mind that I'm not skilled/knowledgeable with databases and this is most likely a skill issue on my part and not an issue with Neon:
My overall stack:
- Hono + Drizzle + Neon + Better auth backend
- Deployed to cloudflare workers
I'm having some pretty bad performance issues:
I'm based in São Paulo, so I chose "AWS South America East 1 (São Paulo)" for my DB region. In my mind this would be enough to ensure a somewhat good speed at least developing locally.
But everything is VERY slow, like 2 seconds per requests on average getting to up to 50s.
My first concern was to fix it in production. I implemented Hyperdrive on Cloudflare (where my app is hosted) and this kinda fixed the issue in production (staging actually).
Locally I kept getting very slow requests and my app kept crashing. So I tested a few things and after when I changed from "drizzle-orm/node-postgres" to "drizzle-orm/neon-http" I noticed a drastic improvement in performance, but then I started to get errors because some endpoints were relying on transactions which are not supported by drizzle-orm/neon-http. I then tried "drizzle-orm/neon-serverless" and apparently everything is working nicely now.
But to be honest I don't really understand whats going on... If I'm in São Paulo and the Neon region is São Paulo, shouldn't I get at least decent speeds always? Why does the driver affect the performance so drastically? And is it really related to locations given that it got drastically better in production with Hyperdrive?
Sorry if this question is stupid...