News for hackers. Stuff that matters.
Re:The economics of a Postgres free tier by fngjdflmdflg on Thursday July 11, 2024 @06:16PM (#40941093)
Yeah, but there is a point (about 1 hour, last I checked being a few months ago) where you start getting cold starts in Neon. You can call that being active the whole time but CockroachDB doesn't have this problem. If I had to rank it:

"Live" database > CockroachDB (few hundred ms) > NeonDB (2-3 seconds) > traditional cold start. This is just my impression and the data is made up but that is how it has felt as a user. So there are definitely levels of "scaling to zero"

Re:The economics of a Postgres free tier by tristan957 on Thursday July 11, 2024 @06:50PM (#40941304)
When you scale something to 0, indeed there are issues with cold starts. On the Neon free tier, you will get a cold start if your database is inactive for 5 minutes (you can configure this value on paid plans).

As an exercise, I decided to try for myself what my cold start time is + query round trip, on Neon's free tier. Note that I am in Austin connecting to us-east-2.

    $ time psql -c 'SELECT 1' 'postgresql://neondb_owner:<password>@<endpoint>.us-east-2.aws.neon.tech/neondb?sslmode=require'
    Null display is "(null)".
     ?column?
    ----------
            1
    (1 row)


    real    0m1.156s
    user    0m0.036s
    sys     0m0.020s
You can't make a trend out of 1 data point, but thought I would provide it nonetheless.
Re:The economics of a Postgres free tier by skybrian on Thursday July 11, 2024 @07:27PM (#40941535)
Last year I was playing around with Neon and the cold starts were slow enough that I implemented a “Loading…” dialog box.

I haven’t touched it in a year, but I tried it just now and it still works. Cold startup for the Deno Fresh instance and the database query were about 700ms each, assuming I interpreted my logs correctly.

Subjectively, it’s slow enough that it’s worth putting up a dialog box, but it disappears fast enough that you don’t need a spinner or progress bar. A meta-refresh of one second seems good enough.

(I’m in California but the demo uses an East Coast instance for Neon. I set it up that way because I wanted to know how it would feel.)

Demo: https://postgres-counter-demo.deno.dev/

Source code: https://github.com/skybrian/postgres-counter-demo/

Re:The economics of a Postgres free tier by davidgomes on Friday July 12, 2024 @02:11AM (#40943060)
We also have this demo:

https://neon.tech/demos/instant-postgres

(Neon Employee)