The economics of a Postgres free tier
xata.io
xata.io
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?
Three Docker Containers: Postgres, NGINX, PostgREST
Or Pocketbase if that's your sort of thing.
Automate snapshots for backups: €0.0131/GB per month.
Which is where a lot of the extra cost comes from.
Serving many very small customers like that is a thankless low-profit task. Some of your costs of doing business won't scale down perfectly beyond a certain point so you won't make nearly as much from 1000 2$ customers as you will 100 $20 ones. The same for numerous technical matters. And that is before you think about SLAs and support - you might have realistic views on what to expect for $2 but having worked at the cheap end of web hosting I can assure you that a great many will not, especially at times when things don't go 100% right.
the hope is that some customers will grow and bring more revenue from more expensive plans and services.
Nobody wants a customer who values a service like that at $2.
I agree.
But...
Reading the OPs post in the most favourable light, it sounds like what he'd like would be the existing "free" service, but to have a wait to pay for it in an attempt to ensure it'll still be worthwhile for the company to keep it running long term.
They say 'the cost for an "active but lightly used database" is somewhere between $1 and $2.5 per month.' so it's at least the right order of magnitude.
But one single support call to an entitled "paying customer" blows away any benefit here, so you're probably right that it's a bad idea.
But accept $2? Now you’re knowingly taking money from a cheapass, and you owe them some level of service, support, and commitment as they’re paying you.
Free customers are worth so much more than $2 customers.
Guess you would have to do yearly billing to not have it all eaten by processing fees.
Compare local bus tickets vs taking a cab. The taxi costs 20x more, but in the best case scenario, they provide exactly the same value! If the bus is late, cold or overcrowded, I have no expectations to get refunded or even an apology. I just have to suck it up. This happens rarely enough that I still accept it and hand over my trust to them.
There is no illusion that my $2 bus ticket alone is enough to keep the bus running, in contrast with the cab.
(Bus companies having a tough time to profit is an orthagonal issue, taxi drivers struggle a lot too)
As the article explains, it won't even cover the base hardware costs. So you won't be "paying your part". The only reason to offer something like this is to "up-sell" to an actual properly paid plan, and since you will also lose quite a large percentage to payment processor fees, have extra support/admin overhead, deal with users who now feel entitles to "paid support", having a $1 or $2/month price point is just not worth it.
You will either need pay for it, or do it yourself on a cheap Linode VPS or Hetzner machine or whatnot.
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?
I can add, that I actually had this setup running on Fly for a small analytics backend for a low volume website.
When I tried to login to the interface after some months I discovered that everything had been broken for at least some weeks - to a degree that I could not recover anything from the volume.
Love the business model! Ability to just load 50$ on to my account and let is run.
But I don't dare to use your services to anything but ephemeral dev envs.
This is one of those instances where an unmanaged single node Postgres sucks to use.
You could choose a webhost with a database included.
Keeping it running with no users is easy. Keeping it running when someone ships an app that blows the DB up is hard.
I just want to pay the cost price for an equally scaled down offering.
The article makes it very clear it's costing them $1 - $2.50 per month to provide, but that they're treating that as marketing/acquisition costs.
And "the cost price" for a free service isn't the cost price for exactly the same service as a subscription service.
As others are pointing out, the risks to them of you assuming you're entitled to something more than their free offering users get - like having them respond to a support or billing query, or feeling entitled to doing term service availability - is problematic enough that it's not likely to be worthwhile.
And at $2 per month, credit card processing eats a big chunk of each payment up front. And it requires setup of the recurring payments and account management, payment reminders and failed recurring billing notification, invoices and tax compliance crap.
And to top all that off there's the fraud risk of people using stolen card numbers or using the service as a small transaction verifier for validating stolen card numbers. When a cardholder disputes a transaction you get hit with a chargeback fee, somewhere between ~$15 and as high as $100 depending on a bunch of stuff. If you don't have decent fraud detection and rate limiting, some asshole who's just bought 1000 credit card numbers off the dark web can make for a _very_ expensive day for you.
And then there's all the internal accounting and reporting they'll need to do for this new class of paying user.
I get what you want to do. But honestly? I can 100% see why most people would refuse to enter into a paid account type relationship with anyone for anything as low as $2/month. Hell, in the last few years Google hseem to have gone from their old price point of $5/month for paid Gmail accounts up to I think $12/month now.
I explicitly wrote "[same] limits as what these free databases offer". So there is no additional entitlement by taking payment.
> And at $2 per month, credit card processing eats a big chunk of each payment up front
You are over-indexing on a specific way to take payment. It could be loading 50$ on your account that is being deducted 2$ a month - Like Fly does it.
Re. fraud risk, accounting etc. I think your assessment is completely opposite to the reality. The following is from a Fly newsletter:
> Charging a credit card prevents most at-scale abuse. Abusive users are surprisingly loathe to pay even $5, and it's really difficult to keep fraudulent credit cards working over time. And when we run charges, we get really interesting Stripe data about the trustworthiness of a charge that we can use to restrict the platform.
Fly has the business model, xata.io apparently has the budget to self-finance this. Why not just combine it?
Really to understand that this is in addition to other offering. Of cause you can not expect to get an enterprise-grade Postgres instance for 2$ a month. But what Xeta claims to offer for 2$ a month should absolutely be possible, and enough for a small database that runs rudimentary analytics for a small-scale blog, etc.
I honestly believe that's what _you_ would expect for your $2/month.
And if everybody in the world was like you, it'd make sense for them to do it.
But...
You've met _people_, right? Enough of them are way too insane and over entitled, and ruin it for everybody else.
And I think you misunderstand the credit card fraud risk here. It's not "abusive users" trying to buy your service at $5 or $2. It's _because_ the monthly price is so low that you become a fraud target for proper who were never interested un becoming a user. Criminals intentionally find and use low value purchase options with real time card processing, so they can "test" card details they have are valid right before making a big purchase if the small one succeeds. I've been on both ends of that, I've seen purchase of a dollar or two on one of my cards right before an attempt to buy a thousand bucks worth of electronics (which my Visa issuer blocked). I've also been involved in a website that mostly dealt in 50+ dollar purchases that without thinking/knowing added a $1.95 novelty sticker pack - and a few weeks later had several hundred purchases using stolen credit cards overnight. It happens.
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/
You're better off just self-hosting postgres in docker on your own vps for $4-5/month.
100 paying customers in that category is still only $200, which isn't even enough for groceries for a family for a month. and for how much hassle?
Especially if you only offer 2 year prepaid options.
So how does this work? I sign up and get a Postgres connection string. Where is it? Because the where _really_ matters. Do Xata and the other examples of this all deploy into all the cloud providers and all the regions and let you choose which one? That feels like a big duplication of effort and like it would be harder to get critical mass in order to get the unit economics to work. Or do people just put up with a database 10ms away?
https://xata.io/docs/getting-started/available-regions
Looks like it’s using AWS Aurora under the hood:
https://xata.io/blog/serverless-postgres-platform
But also, they’ve done some work to reduce the number of network round trips that Postgres needs to respond to a query. For many situations, SQL over HTTPS is used. In JavaScript, the database driver is a wrapper around a fetch request.
Xata seems to have its own SDK with higher-level API’s to reduce round trips.
Also: https://xata.io/blog/geo-distributed-postgres
Meanwhile, here’s Neon’s blog post on their connection options:
https://neon.tech/blog/http-vs-websockets-for-postgres-queri...
That said, I’ve used AWS DBs with Cloudflare pages and the latency isn’t a major issue. If you are running non geo-distributed DB, the DB is a lot further than 10ms away from your average user.
That said, thanks for the experience. Do they also tend to launch in other cloud providers? It seems like it would be a tricky business to navigate, restricting your customer base to specific providers.
As for the latency, it might not matter for all applications, or it may encourage the devs to spend more time optimizing the number of SQL queries.
> 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!
I have had to correct others in our Discord server for instance too.
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...
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.
Nobody knows your product as well as you do.
i could see all the "static" content, but validating email or the dashboard just fail.
console gives some js error about preloading a css url
"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"
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.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/
https://neon.tech/demos/instant-postgres
(Neon Employee)
I was looking for a free cloud database I could use to host some shared data for my small free open source project and this should do nicely.
I probably wont ever even use more than a dozen MB or so and such low traffic.
Basically it's an app for remote controlling home theater equipment, and I wanted to give users of the app a centralized database to add the little text commands that they find and use for their various device control. So that new users can get a list of commands that other users have written/found for specific devices instead of having to go to the command doc themselves every time.
And I doubt ill ever have more than maybe a couple hundred users tops.
Wouldn't you use an AMI of choice, self-host, or use one of the cloud native solutions? Seems like piping all your DB calls outside your VPC would have a lot of downsides, not the least of which is a lot of latency (I get there is peering infrastructure). Also, there are security issues to contend with, threat surface is much larger with a DB available to the internet vs a DB on a segmented private network only available to the middle tier.
Is it a cost thing? Is something like xata or neon cheaper than say AWS Aurora? I don't see how it could be cheaper with all the inherent egress costs.
I guess if their customers are mostly already using AWS, that would be a bad idea because of AWS data transfer fees then applying?
> Xata is the only serverless data platform for PostgreSQL.
ummm. what about https://neon.tech/?
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.