News for hackers. Stuff that matters.
Re:The economics of a Postgres free tier by tristan957 on Thursday July 11, 2024 @06:04PM (#40941009)
Responding with my Neon employee hat on:

> Neon is scaling databases to zero and offer a certain number of "active hours" in their free tier.

Neon's free tier allows users to run their database 24/7[0]. That means you could keep a database alive all the time if you wanted. Quoting the pricing page:

> 24/7 for your main database

In addition to the 24/7 usage on the free tier, Neon additionally gives you 20 compute hours for branches other than your primary/main branch.

Just wanted to clear up the confusion in the article. Not sure why they phrased the Neon section that way.

Edit: The author has corrected the statement about Neon. Thanks!

[0]: https://neon.tech/pricing

Re:The economics of a Postgres free tier by tudorg on Thursday July 11, 2024 @06:31PM (#40941202)
[Author here] I'm sorry, I must have misunderstood or remembered old information (was it always like that?). I have fixed the phrase in the blog post.
Re:The economics of a Postgres free tier by tristan957 on Thursday July 11, 2024 @06:39PM (#40941246)
The understanding of the Neon free tier and the term, compute hours, has been something we are always trying to clear up, so it would not surprise me if the phrasing changed at some point in time, but the free tier has always allowed a user to run a database continuously as far as I remember.

I have had to correct others in our Discord server for instance too.

Re:The economics of a Postgres free tier by kljfds on Thursday July 11, 2024 @07:05PM (#40941390)
It wasn't that way last year, and coldstarts were measured in seconds.
Re:The economics of a Postgres free tier by tristan957 on Thursday July 11, 2024 @07:14PM (#40941449)
I went all the way back to just a few days after I started[0]. I can't find any restrictions on the free tier uptime for the primary/main database in any of the Wayback Machine snapshots of https://neon.tech/pricing.

Last year we did take a lot of heat for cold starts. Here are two blog posts which discuss how we have worked on cold starts.

1. https://neon.tech/blog/cold-starts-just-got-hot

2. https://neon.tech/blog/posix_spawn-close_range-fixed-cold-st...

[0]: https://web.archive.org/web/20230517084346/https://neon.tech...

Re:The economics of a Postgres free tier by kljfds on Thursday July 11, 2024 @08:05PM (#40941712)
I can't say this is the disconnect some are having, but it's the one I did until just now. I read "24/7 compute" and assumed that meant no cold starts. It really meant "up to 24/7 uptime but it will still scale to 0 and require cold starts."
Re:The economics of a Postgres free tier by tristan957 on Friday July 12, 2024 @12:29AM (#40942739)
The free tier has mentioned that auto-suspend isn't configurable on the free tier for every archive I could find on the Wayback Machine.

If you want an always on compute on the free tier, you can just setup a cron job, and every 4 minutes or so send a "SELECT 1" which will keep the database awake.

Re:The economics of a Postgres free tier by czaxvgdcs on Friday July 12, 2024 @09:48AM (#40945553)
There’s a disconnect here. You are 100% technically correct. Your product’s messaging is confusing. Saying “24/7 compute” makes some people think no cold starts. Enough people in fact that you have to keep correcting them.

Nobody knows your product as well as you do.

Re:The economics of a Postgres free tier by tristan957 on Friday July 12, 2024 @10:08AM (#40945710)
I'll provide this feedback. Thanks for your explanation.
Re:The economics of a Postgres free tier by 1oooqooq on Thursday July 11, 2024 @07:13PM (#40941440)
Are the servers hugged to death? all I get is a picture of a harddrive and "something went wrong".

i could see all the "static" content, but validating email or the dashboard just fail.

Re:The economics of a Postgres free tier by tristan957 on Thursday July 11, 2024 @07:17PM (#40941465)
The web page is working for me. Can you give your web browser and operating system specs?
Re:The economics of a Postgres free tier by 1oooqooq on Thursday July 11, 2024 @07:30PM (#40941542)
firefox with standard install of ublockorigin.

console gives some js error about preloading a css url

Re:The economics of a Postgres free tier by tristan957 on Thursday July 11, 2024 @09:40PM (#40942107)
I'm also on Firefox with tracking protection and uBlock Origin. Can you give the full error?
Re:The economics of a Postgres free tier by 1oooqooq on Friday July 12, 2024 @09:58PM (#40951163)
sent at the time via the "send feed back" link on the site.
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)

Re:The economics of a Postgres free tier by riku_iki on Monday July 15, 2024 @05:09PM (#40971484)
For free layer: can it lose my data? Has data been replicated and be picked up if server dies?