[HN Gopher] The economics of a Postgres free tier
       ___________________________________________________________________
        
       The economics of a Postgres free tier
        
       Author : todsacerdoti
       Score  : 37 points
       Date   : 2024-07-11 17:43 UTC (5 hours ago)
        
 (HTM) web link (xata.io)
 (TXT) w3m dump (xata.io)
        
       | cultofmetatron wrote:
       | from their homepage
       | 
       | > Xata is the only serverless data platform for PostgreSQL.
       | 
       | ummm. what about https://neon.tech/?
        
         | corytheboyd wrote:
         | Wow, I usually hate marketing pages but that one is awesome
        
         | snide wrote:
         | Xata employee here. The clarification would be "platform" vs.
         | "host". You get a lot with Xata beyond the core Postgres
         | offering. We automatically replicate to OpenSearch for a great,
         | fast search experience, provide file attachments through the DB
         | itself (with image transformations), provide a pretty cool
         | editor, and are now starting to think heavily towards how
         | migrations could be better (more on this next week). No knock
         | against Neon, who build cool stuff too.
         | 
         | I agree "only" is likely a little aggressive, but marketing is
         | tricky and sometimes the A/B gods appear. We've switched this
         | one-liner a few times in the past year. I'll provide that
         | feedback to the team in any case.
        
       | tossandthrow wrote:
       | I would love a service, where I can pay 2$ per month, pre-paid,
       | something like my email, and then get a worry free Postgres
       | instance - some limits as what these free databases offer, just
       | for 1-2$ a month so that I know that I pay my part and that the
       | database is kept alive.
       | 
       | But all DBaaS's seem to offer free or at least 20$ per month,
       | which is excessive for a small hobby project.
       | 
       | Does that exist?
        
         | noja wrote:
         | Where does that $2 a month price come from?
         | 
         | You could choose a webhost with a database included.
        
           | krageon wrote:
           | A small db user costs almost nothing to the host. It'd be
           | like a shared webhost, except there's _none_ of the overhead
           | of running the programming language (e.g. php). That is by
           | far the most expensive part of the machine. Offering this for
           | around that price is a proposition that will have significant
           | RoI in terms of hardware used.
        
             | filleokus wrote:
             | I guess that's true now with these "serverless" databases
             | where compute and storage is separated in a neat way.
             | Otherwise you either need to be ok with keeping the whole
             | [?]vm alive, or have a really old school shared database
             | setup ala 2004 web hosting... Maybe it's no problem, but
             | feels kinda icky?
             | 
             | But regardless, I agree with you. I can spin up the
             | cheapest fly.io machine for 2 usd / month, or some DO
             | droplet/function, but neon and these guys are either free
             | or 20. It always feels better paying a bit than nothing.
             | 
             | I know CockroachDB has some serverless > 0 (but cheap)
             | pricing https://www.cockroachlabs.com/pricing/
        
             | mrkurt wrote:
             | A small db isn't free to _operate_. The actual compute and
             | storage costs are pretty low, but keeping the thing running
             | is harder than you'd think.
             | 
             | Keeping it running with no users is easy. Keeping it
             | running when someone ships an app that blows the DB up is
             | hard.
        
         | tristan957 wrote:
         | Heroku has a max $5/month plan if I am reading their plans[0]
         | correctly. Not sure if that meets your definition of worry-
         | free.
         | 
         | [0]: https://elements.heroku.com/addons/heroku-postgresql
        
         | mrkurt wrote:
         | You can run a Postgres on Fly.io full time for just slight more
         | than $2.
         | 
         | It's not a great business though. The compromise you're making
         | is that we don't manage it. It'll probably stay running, it's
         | likely to be worry free (especially if you barely use it), but
         | if anything goes wrong it's up to you.
         | 
         | You could also spin up a VM for cheap somewhere, install
         | Postgres, and just let it be.
         | 
         | Managed databases are expensive to run - worry free costs quite
         | a bit of money to ensure. Maybe you don't need that for a hobby
         | project?
        
         | web3-is-a-scam wrote:
         | just get a vm on something like Vultr and install postgres on
         | it
        
         | TechDebtDevin wrote:
         | Hetzner 2vCPU 4GB RAM 40gb: EUR4.50 per month.
         | 
         | Three Docker Containers: Postgres, NGINX, PostgREST
         | 
         | Or Pocketbase if that's your sort of thing.
         | 
         | Automate snapshots for backups: EUR0.0131/GB per month.
        
         | reducesuffering wrote:
         | Supabase is free but only slept after 1 week of inactivity.
        
         | renewiltord wrote:
         | People who want to pay that little and can't manage it
         | themselves are very demanding. Better not to do business with
         | them. I have a $2.50/mo racknerd machine. Just bare Linux. Just
         | do something like that. If you don't want to, chances are that
         | no one wants to manage it for you either.
        
       | password4321 wrote:
       | Last I checked: Supabase deactivates after 1 week, Render deletes
       | after 90+14 days.
        
       | tristan957 wrote:
       | 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
        
         | fngjdflmdflg wrote:
         | 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"
        
           | tristan957 wrote:
           | 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.
        
         | tudorg wrote:
         | [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.
        
           | tristan957 wrote:
           | 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.
        
       ___________________________________________________________________
       (page generated 2024-07-11 23:00 UTC)