My "serverless" database was billing me like it never slept.
Neon has this great feature called scale-to-zero. Your Postgres compute suspends when it's idle, so you only pay for the queries you actually run. For a pre-revenue product, that should cost a few cents a month.
Mine ran 24/7. The compute never once scaled to zero.
The culprit wasn't my app logic. It was my database driver.
I was using postgres-js, which holds a persistent connection open to the database. From Neon's side, an open connection looks like activity, so it never suspended. It just stayed awake and kept quietly billing me.
The fix was basically one conceptual change: switch to @neondatabase/serverless, the HTTP driver.
Instead of a long-lived connection, every query becomes a stateless one-shot HTTP request. The query fires, the connection closes, and the compute is free to suspend.
Scale-to-zero finally worked.
The lesson I keep relearning as a solo founder: "serverless" is a property of your whole stack, not a checkbox on one service. One persistent connection upstream and the whole cost model breaks.
Top comments (0)