Doesn't HAVE to be free isn't the free tier of PlanetScale a production level database? At least for tiny hobby apps? Otherwise maybe I'm misinterpreting what production-level really means.
It's actually not 1-1 postgres, the forced upgrade to supavisor broke some stuff for me.
Luckily I was only using it for local dev and not a production workload.
https://github.com/riverqueue/river/issues/238
Supavisor should support 100% or Postgres, it’s just a proxy like RDS proxy. I’ll flag this with the team - apologies for any regression this caused
Just so you know, you can also connect directly to the database (bypass Supavisor). The connection details are in the settings page
Can't talk highly enough about this product. Have tried lots of different options for various projects but everything uses Supabase now. Even when Firebase has a more complete offering with things I need (e.g: Crashlytics, monitoring, etc) I still start with Supabase and add on the other parts with other open source offerings. I'm much happier with my stack now.
I use Neon’s free tier and really like it.
Not directly related but worth noting that 100 concurrent users doesn’t equal 100 concurrent connections (if you’re using a fairly normal setup, if not ymmv)
The server will keep a number of connections open in a pool, and will queue up requests and use them as needed.
Having 100 users with a page of your site open doesn’t mean you’re making database requests concurrently, you only make a database request when you load a new page or interact with the server. Given a database request should last in the milliseconds, it’s unlikely you’re going to have all your users requiring a connection at the same time (and even if they did, their request would just take slightly longer than normal).
You will almost definitely be able to handle 100s of users with only a handful of database connections.
And I’m pretty sure neon and the rest of these db as a service providers automatically provide connection pooling, so even if you do have more than the allocated connections attempting to request, they just get queued up.
Hey, that's right! Neon offers two connection URLs a pooler and direct URL. The direct URL might be necessary when performing certain operations, e.g migrations. Best to use the pooler URL if you expect to have multiple instances or many clients accessing your database, e.g with edge/serverless functions where multiple replicas can be scaled up in response to demand.
> The server will keep a number of connections open in a pool, and will queue up requests and use them as needed.
So I always thought this was a big problem with serverless functions, which many Next.js projects are using: they can't make use of a shared connection pool. Every serverless invocation is isolated and needs a new connection to the database, and has all the overhead that entails. It actually makes them slower than "traditional" serverful deployments.
You’re right, and I did oversimplify my reply. But there are increasingly ways around this, for example Neon, Superbase and other providers offer pooling at their API level, and Neon also offers their own driver specifically for serverless which uses websockets to talk to their API with low latency.
What are the limitations of Turso(sqlite) when it comes to data types that an app needs. Like for example sqlite is notorious for not supporting boolean types, did the libsql fork fix some of sqlite's problems to make them compatible with modern applications?
> What are the limitations of Turso(sqlite) when it comes to data types that an app needs.
Most of the SQLite limitations apply to Turso, since it is a soft fork and we keep merging from upstream.
> Like for example sqlite is notorious for not supporting boolean types
It was the case earlier! but SQLite now supports boolean keywords since 2018 - https://www.sqlite.org/datatype3.html#boolean_datatype
> did the libsql fork fix some of sqlite's problems to make them compatible with modern applications?
yes! we have added some changes. Full list of changes are [here](https://github.com/tursodatabase/libsql?tab=readme-ov-file#features) The notable ones are:
- `ALTER TABLE` extension for modifying column types and constraints
- WebAssembly User Defined Functions
Hi. I'm interested in hosting my SaaS in Turso. I heard one of the biggest problems with SQLite is write concurrency. Realistically, how much can we write concurrently? Is there any article discussing benchmarks or tests around this?
> I heard one of the biggest problems with SQLite is write concurrency.
that is true. Since Turso is a fork, some of the limitations do apply.
> Realistically, how much can we write concurrently?
It all depends on the workloads. Are you using transactions, batching, how big is the data etc. As a ballpark number, upto 1000 writes per second should be fine.
> Is there any article discussing benchmarks or tests around this?
we dont have any, but I will leave this feedback to the team!
I forgot to mention one thing. Turso gives you 500 databases in free plan (or 10000 databases in Scaler). If you can shard your data, then you essentially get super high write throughput
I really like pocketbase, very easy to use and with the massive benefit of a dashboard built in.
I built a side project that will sit there for years and I would rather not have to think about the server that it's running on and updating anything/paying for...this would happily sit on a free tier somewhere else
Just go for it dude, you'll be surprised at how much of a non-issue it is. They make such a big deal out of it which for the majority of people just doesn't apply
That's because self-hosting your own database is a shitstorm waiting to happen once you get more than 1 user. Security is a big deal, and handling it on your own is far from being a smart move.
Honestly ive struggled to find a straight answer of what self-hosting means, can you help provide an example?
Edit: to clarify, are you referring to something like running a docker container on a cloud server vs something like supabase? or what do people mean when they refer to self-hosting
Amazon Lightsail had some pretty cheap managed databases. I think you can get one for $10-$15 a month. Or spin up a digital ocean droplet and self host a MySQL database.
Just caused no one mentioned it, Convex DB is great. Has a generous free tier at 0.5gb and is setup as a database service using Amazon RDS.
[Convex DB](https://www.convex.dev/)
Edit: storage amt.
have you looked at supabase?
could be a good fit, not 100% sure on current pricing -- pricing for production use-case may get pricey as well (given the price points you mentioned)
Full disclosure, I'm head of product at Xata (https://xata.io) 👋
We are building a data platform for PostgreSQL that you might find interesting. Our serverless architecture allows us to provide a pretty generous free tier with a few additional capabilities required for application development such as file attachments (storage) and full text search. We see production applications use this tier regularly and upgrade as they scale. Our TypeScript SDK also pairs quite well with NextJS. If this sounds interesting and you have any additional follow up questions, we're always around in discord https://xata.io/discord
Best of luck in your search for an alternative to PlanetScale!
As a web dev, I'd much rather be responsible for a self-hosted database, which is basically just an install and knowing how to connect, than a web server, which is bunch of moving parts, especially with node apps...
No, just no. So much fear mongering around self hosting. Majority of people don't need all that except for automated backups which is easy to set up yourself. And any VPS provider easily allows you to scale vertically. All of this can be solved without hiring dedicated engineers or spending 120K a year like some youtubers want to make believe.
I've self-hosted a few DB's in my time and it has been a PITA 85% of the time with no real benefits. the only time I will do it is if a client really has to or needs to have their DB on their own infra for some reason. and in that case I will ask them to provide it themselves.
Really? What made is such a PITA? I have DBs that ran for a decade with little issue or effort. I think a lot people have problems when using it with docker, as docker will get bad overtime and run unstable. If you run it bare metal, no problems.
Well, I'm by no means a DB expert, and not very knowledgable in DB mgmt, so:
- Having to manage creation of backups/snapshots and the safe storage of those backups/snapshot
- recovering backups/snapshots
- Scaling, replication, etc
- updates and upgrades
- user mgmt
- tweaking for performance
- security
You know, the usual things a DBaaS will handle for you. I don't need to perform those things often, usually only at the onset of a new project, so I don't gain lots of knowledge about them and know just enough to "get by". And these things don't interest me either.
I usually work on a team of developers in a company that builds software for our clients and if those clients have a budget that can fit
a DBaaS (usually a few dozen dollars a month) with all the facilities and ease of use that it provides, and if it fits the client's requirements for where their data is allowed to go, we go for a DBaaS.
> as docker will get bad overtime and run unstable
Now that seems strange to me. The DB's that I do 'self-host' are in Docker together with an API and a reverse proxy on an EC2 instance, for example, and they're usually up for months at a time, only needing to be brought down to upgrade the OS on the EC2 instance and such.
Yeah, months. Not years. Usually you destroy and rebuild the containers.
Ok, if you are building it for clients than I understand. It's faster, but it not as difficult as people make it out to be. Having basic knowledge of how to set up databases should be a part of fundamental education of any fullstack web developer. So many developers have never touched bare metal, that they literally got the rug pulled from under their feet when Planetscale stopped their free tier simply because they have never setup their own database.
If you are looking it from a time constraint and are not paying for all the servers, then I agree. But if you are doing your own projects and have to pay for everything yourself, then self hosting can be beneficial as it gives you an alternative to vendor locks, be it aws dynamo or mongodb.
Personally, I haven't tried doing this yet but I keep hearing that you should definitely avoid self hosting until you REALLY know what you're doing. It felt more efficient to go with a provider and just focus on the stuff that matter with the time I save. But I don't exactly like the idea of how things are so abstracted away from you nowadays, so I'll definitely give self hosting a try eventually!
You know who benefits the most from pushing that fear mongering narrative that self-hosting is scary? Influencers and providers.
It's not scary or crazy difficult to host your own services, in fact that's what we've been doing before all these \*aaS companies came along.
Heck, installing XAMPP was literally the first thing we did in school when I just started learning software development.
If you don't host sensitive info and don't have money for a paid cloud db, just buy a vps and host it yourself.
Just buy 5$ vps from digital cloud and play with it.
People who know how to stand up backends using the AWS SDK or CDK make very impressive salaries. It is not realistic to just expect everyone to be able to do that, its the whole reason this class of service exists. So devs can avoid direct contact with AWS who want to.
What’s the point of building something from scratch if you can’t do it better than the services that already exist?
Do you really think a team with 5, 10, 20 people can outperform an entire company that is dedicated to that resource (db, auth, etc…)?
“Everything” is too broad.
Auth, databases, CMS, ERP… those aren’t things you can easily do with security, scalability, flexibility in mind, at least in a timely manner that doesn’t prevent product shipping.
The problem with that argument is the following: A cook can probably cook better than you, so why cook? You can extend it to everything till you rely on everything for everything. And that’s exactly what we are drifting towards too. Many people don’t have a basic skillset anymore. Many devs can’t setup a database, a lot of devs don’t even know what NVMe is and so on. We are collectively getting dumber and we enjoy it. We will see the price we pay once we are fully reliant for everything. Fits right into the WEF saying: “You will own nothing, and you will be happy”. Are you friends with Klaus Schwab by any chance?
Lacking the skillset has nothing to do with how the company you work for structures their business.
Having third parties is no excuse for the lack of skills.
Also the cook analogy would be fine if creating a database would be the equivalent of smashing two lettuce leaves together
I mean, the easiest is to just spin up one EC2 t2.micro (free tier) and host your database there. It's fast, easy, especially if you're using it for a hackathon. You have every control you could ever need. And it's probably replicable (very close) to what your local development environment is—easy to debug if things go wrong.
Even if not for a hackathon, self-hosted database servers are common in production apps, too.
>would lead to a more valuable learning experience
Also, self-hosting your database server will definitely give you a valuable learning experience in hosting *literally anything*.
RDS is a great choice, even for large apps with big, very big databases (future-proof)!
But of course there's a small learning curve (like literally every AWS service), and that it's still a *managed service*. But one gets many database ops feature for free (well, not exactly free since you paid for it, but you get my point).
If OP is scaling up real quick, they can consider RDS. If they only have 1 hour before the app launches and need to deploy, I think ~~you need to wake the hell up~~ EC2 is a cheap and dirty solution, since if you've set up your database locally, you can set up your database in EC2.
Thanks! Self-hosting seems like an amazing learning experience after reading through all these comments. But it's something I would try out on a personal project for learning purposes. I feel like it's a risk to introduce it to a team full of new developers. They may end up learning less or get demotivated if the learning curve is too much.
You mention its an hackaton, so its something that will be very short lived? a few days at most?
In that case, maybe using something established like AWS RDS or GCP Cloud SQL where you pay only what you use? And maybe you can even get some credits for new users.
You can specify quotas and limits for usage I believe, so you could avoid a big bill by mistake
This can become expensive if running 24/7, but for a few days, I think it can be a great option.
You could also look in Digital Ocean Managed database services, for example
It's actually the main website for the hackathon itself, so we'll be dealing with hundreds of user registrations plus have other social media like features. I've made a whole bunch of full-stack applications as personal projects but never had over 30-40 users. So I was just worried about what happens if there's a hundred or more users. But after reading through the comments, seems like it's not something I should even have to worry about.
Thanks for suggesting the quota limit. This is something I didn't know when setting up a database with GCP in the past, and then accidentally kept it running for 11 days lol
100 or more users should not be a big deal 👌🏻
Just whack it on supabase if you want a paas with auth built in or railway if you want quick easy and autoscalable.
The latter has a lack of things like backups though I believe.
https://aws.amazon.com/rds/pricing/
"Amazon RDS is free to try and you pay only for what you use with no minimum fees."
And also checked their calculator and you can specify the number of hours per month.
You don’t need 100 db connections for 100 users. Regardless of where you deploy to each connection can serve more than one user because whatever is connected to the db (either a serverless function, or a docker run instance of nextjs) can handle much more than one user at a time.
If you spin up a server based api you don’t have to worry about connections at all as you will effectively just be using 1.
So you can just do that instead of serverless if you are concerned.
This news sucks for sure. I decided to try out the Vercel Postgres since I'm already paying for Pro. Seems to be working well so far after doing some db dumps from planetscale and running the SQL scripts manually to move data over. So, might be worth considering if You're already on the Vercel ecosystem.
I'd like to hear some suggestions on what provider to use that plays well with Cloudflare Workers. PlanetScale had a nice lib for that but for my use case their paid plan is an overkill, can't afford that.
Like others have said, Supabase is a good alternative. It's Postgres underneath but if you use Prisma, your migrations should still work with pg. You may have to change up some datatypes and you'll probably have to change your datasource in `schema.prisma`. Other than that, it shouldn't be much of a change since most of the database handling logic is managed by prisma.
Vercel have made Next a nightmare to host outside of these fucking edge environments.
You've gotta hack around with middlewares to get access to Node APIs and enable experimental features. It's no surprise people are leaning towards these environments.
Can you suggest some? I just got oracle cloud free tier to learn/test for the first time. Trying to deploy nextjs on an instance there but unable to find a good resource.
If you're looking for free, you might not find any. AWS might be a choice, though as far as I know their "12-month "free tire" doesn't actually cover a full time month each month. Of course.
If you're looking for paid solutions, u/soggynaan got you :)
Thanks for the mention u/doobltroobl
Also, I forgot to mention but here's a great website for comparing Cloud providers: [https://getdeploying.com](https://getdeploying.com)
But u/Redicus as you said in another comment you're feeling good about DigitalOcean, well the good news is that with a VPS you often only pay for what you use. So you can spin up a $4 VPS with DigitalOcean and use it for let's say 48 hours to learn the ropes, and destroy the VPS after, you'll only pay for those 48 hours you've used the VPS for which will be just $0.28!
This allows you to not be chained to just DigitalOcean, as you can try out different providers until you're satisfied and only pay for the time your VPS was active.
Compare that to PaaS/IaaS like Vercel, PlanetScale, etc, you gotta pay for the whole month in advance even if you don't use it to full capacity.
But honestly if I were you, I'd stick with that Oracle free tier or AWS EC2 free tier **strictly for learning purposes** and not hosting anything business-critical (especially not on Oracle). Heck, you could even use a spare pc/laptop with Linux installed or a VM on your main PC to learn, which is what I'm currently doing (Debian VM running Proxmox locally and treating it as a remote environment).
GL!
$0.28 for testing is very cheap, thanks for the suggestion!
As for Oracle, i am unable to get the free Instance as its reached capacity. Its been like this for years. The only shape i could get is a Micro instance with 1GB memory and 0.6Ghz CPU which crashes if i install any package on it.
Will keep in mind not to use it for important data thanks!
Because the existence of such one click deployment has made people too comfortable... Whipping up a vps, configuring it and hosting a DB in it live and managing it has been abstracted to a point that the new gen doesn't EVEN KNOW what that means....
You shouldn't have anything to worry about. A couple things:
1. Your server shouldn't be using one connection per user. In fact prisma defaults to 2 * num_physical_cpus + 1, so depending how you're running your app you shouldn't be using more than 20 or so connections (max). If you HPA in k8s and have e.g. 10 pods each with <= 1 cpu, then you would only have 3 * 10 = 30 connections max. And even then, that's an upper limit on connections. If a pod isn't serving much traffic, it may not need to open more than one connection
2. The limit is actually 10,000 connections in Neon assuming you set pgbouncer=true on your connection string. This is independent of plan, and true for free plan as well.
https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool
https://neon.tech/pricing
Presumably he’s using vercel to deploy his next app on a hobby tier given that he thinks $40 is a lot of money to spend. That means serverless, which means Prisma isn’t going to be pooling connections since concurrent requests are going to spin up new serverless functions with new Prisma instances.
It’s not a limitation of Prisma, it’s a limitation of serverless architecture. If you end up using a product like planetscale or neon that have proxies set up for you you don’t have to worry about the issue if whatever lib you choose can connect to that proxy endpoint.
If that's an issue, you can also get a non-sleeping free instance on koyeb with (I think) 0.1 vCPU and 512MiB. That's a container running and you won't have any connection concerns. It's very easy to set up if you're coming from a vercel app.
Yeah good point. Depending how many requests he's serving I would guess that the lambda functions would stay warmed up and he wouldn't see a large number of containers backing the functions - and with a 10K limit on neon there's almost no way he has any issues even with connections being left open etc. But I also forget if vercel spins up a separate lamba for each API function or a single lambda. If the latter then he'd still be fine.
Thanks so much for this. It clarifies things down a lot further. When I was first told about how I should watch out for connection pooling, I was told that every new user is a new connection. But they were also a junior developer so maybe they were wrong to an extent. NeonDB sounds like a really good option now!
If you are saying a hundred people at peak just use crunchy data and a aws instance. You can get a 10 dollar DB which can likely easily handle that load.
If it can't you can get double the power for double the money
I'm a little lost as to why this even matters. You could isr a production grade DB for your hackathon from a CSP like AWS or GCP for the time you need it and then delete it.
Most hackathons I've done last 2, maybe three days. Do the hackathon, dump the data, and then export it back. Or just store it in BQ - nearly same cost as gcs/s3 but with significnalty better usability and reliability.
Better idea: see if you can get sponsored!
Also: GCP has $300 in credit for new accts. Other CSPs may have similar offers. That's bettrr than Free Tier IMHO as you can decide to keep - or not.
It's actually not for a hackathon project by for a hackathon itself, the main website for the hackathon where hundreds of people would be applying and stuff. Plus other features that make it more of a small social media like application. That's why it mattered.
I'll see if GCP offers something for students! But I didn't hear anything about the $300 credits for new accounts.
And yes, as we get sponsors for our hackathon, we should hopefully receive some funding that can go into the tech side of things!
just use sqlite + wal mode.
if sqlite doesnt work for your usecase, use mysql + postgres self-hosted.
it ain't that hard & if the db goes down, just use a much beefy server. $10/mo should be easy to host.
use my solution if you want (sqlite + litestream + docker) -> https://github.com/deadcoder0904/easypanel-nextjs-sqlite
I'm in a somewhat similar position...
Although, I only just released my product this past month with Planetscale (only 200 users at the moment) and it's just a small hobby project not making any revenue, so not wanting to spend $40+ dollars a month. I feel I could justify the $20, but $40+ is a bit steep.
So I need to migrate to another MySql solution.
I'm thinking Railway, however their region support isn't great. My users are in UK & Ireland Railway's closest region is Amsterdam. Which isn't ideal.
I see a few have mentioned self-hosting, which I think is a great solution if you have a bit of experience with it, unlike me.
I don't mind paying for the convenience of handling the things I don't even know that I need to handle that managed solutions do for you.
Like need to look into handling backups, switching my logic in some of CI/CD pipelines for e2e testing I currently have with Planetscale, so the mental overhead and additonal time required to learn these extra things I'm not 100% sure is worth it for me, at this time anyway.
Unless someone has a really good tutorial or article going over some of these things on a self-hosted, then I'd maybe consider it.
Another option you could check out is Koyeb Postgres. It runs on Neon and gives you 1 free managed postgres database to run. The paid instance are charged by second making them much more affordable.
You want a free database for a production level application?
Doesn't HAVE to be free isn't the free tier of PlanetScale a production level database? At least for tiny hobby apps? Otherwise maybe I'm misinterpreting what production-level really means.
No I'm with you there. If there was a 20 dollar tier I think the conversation would be very different.
Go with supabase.
[удалено]
It's actually not 1-1 postgres, the forced upgrade to supavisor broke some stuff for me. Luckily I was only using it for local dev and not a production workload. https://github.com/riverqueue/river/issues/238
The forced move to supavisor was specifically for the ipv6 change on AWS’ part, right?
Supavisor should support 100% or Postgres, it’s just a proxy like RDS proxy. I’ll flag this with the team - apologies for any regression this caused Just so you know, you can also connect directly to the database (bypass Supavisor). The connection details are in the settings page
Thanks for the heads up, something looks funky. I've opened an issue on the Supavisor repo: https://github.com/supabase/supavisor/issues/320
This is the one, been hosting all my postgres db's with them and even with the supavisor update, the changes needed to migrate were really small.
Can't talk highly enough about this product. Have tried lots of different options for various projects but everything uses Supabase now. Even when Firebase has a more complete offering with things I need (e.g: Crashlytics, monitoring, etc) I still start with Supabase and add on the other parts with other open source offerings. I'm much happier with my stack now.
I use Neon’s free tier and really like it. Not directly related but worth noting that 100 concurrent users doesn’t equal 100 concurrent connections (if you’re using a fairly normal setup, if not ymmv) The server will keep a number of connections open in a pool, and will queue up requests and use them as needed. Having 100 users with a page of your site open doesn’t mean you’re making database requests concurrently, you only make a database request when you load a new page or interact with the server. Given a database request should last in the milliseconds, it’s unlikely you’re going to have all your users requiring a connection at the same time (and even if they did, their request would just take slightly longer than normal). You will almost definitely be able to handle 100s of users with only a handful of database connections.
And I’m pretty sure neon and the rest of these db as a service providers automatically provide connection pooling, so even if you do have more than the allocated connections attempting to request, they just get queued up.
Hey, that's right! Neon offers two connection URLs a pooler and direct URL. The direct URL might be necessary when performing certain operations, e.g migrations. Best to use the pooler URL if you expect to have multiple instances or many clients accessing your database, e.g with edge/serverless functions where multiple replicas can be scaled up in response to demand.
> The server will keep a number of connections open in a pool, and will queue up requests and use them as needed. So I always thought this was a big problem with serverless functions, which many Next.js projects are using: they can't make use of a shared connection pool. Every serverless invocation is isolated and needs a new connection to the database, and has all the overhead that entails. It actually makes them slower than "traditional" serverful deployments.
You’re right, and I did oversimplify my reply. But there are increasingly ways around this, for example Neon, Superbase and other providers offer pooling at their API level, and Neon also offers their own driver specifically for serverless which uses websockets to talk to their API with low latency.
I also moved to that for quick projects
Turso? If you're okay with sqlite/libsql
Oh yeah that's also one of the options I'm looking into! Thanks
For capacity they're miles better on the free tier than the others. It's 9GB vs 250 or 500mb for all the others I've seen
The question is how long can they subsidize before VCs will ask to tighten the bolts and start making revenue, ala what has happened to PlanetScale
I am happy to answer anything related to Turso (disclaimer: I work there)
What are the limitations of Turso(sqlite) when it comes to data types that an app needs. Like for example sqlite is notorious for not supporting boolean types, did the libsql fork fix some of sqlite's problems to make them compatible with modern applications?
> What are the limitations of Turso(sqlite) when it comes to data types that an app needs. Most of the SQLite limitations apply to Turso, since it is a soft fork and we keep merging from upstream. > Like for example sqlite is notorious for not supporting boolean types It was the case earlier! but SQLite now supports boolean keywords since 2018 - https://www.sqlite.org/datatype3.html#boolean_datatype > did the libsql fork fix some of sqlite's problems to make them compatible with modern applications? yes! we have added some changes. Full list of changes are [here](https://github.com/tursodatabase/libsql?tab=readme-ov-file#features) The notable ones are: - `ALTER TABLE` extension for modifying column types and constraints - WebAssembly User Defined Functions
Hi. I'm interested in hosting my SaaS in Turso. I heard one of the biggest problems with SQLite is write concurrency. Realistically, how much can we write concurrently? Is there any article discussing benchmarks or tests around this?
> I heard one of the biggest problems with SQLite is write concurrency. that is true. Since Turso is a fork, some of the limitations do apply. > Realistically, how much can we write concurrently? It all depends on the workloads. Are you using transactions, batching, how big is the data etc. As a ballpark number, upto 1000 writes per second should be fine. > Is there any article discussing benchmarks or tests around this? we dont have any, but I will leave this feedback to the team!
Thanks!
I forgot to mention one thing. Turso gives you 500 databases in free plan (or 10000 databases in Scaler). If you can shard your data, then you essentially get super high write throughput
This one is new to me too Thanks!
Supabase, Turso, Neon, in that order of preference imo. Turso is SQLite while Supabase and Neon are Postgres.
What happened with planetscale?
They're removing their free tier in April: https://planetscale.com/docs/concepts/hobby-plan-deprecation-faq
thats just perfect. Just launched an app using them. jesus.
Wow, I was literally just thinking of finally using planetscale for a side project instead of pocketbase, but alas, another free tier bites the dust
May I ask you why do you want to move from pocketbase?
I really like pocketbase, very easy to use and with the massive benefit of a dashboard built in. I built a side project that will sit there for years and I would rather not have to think about the server that it's running on and updating anything/paying for...this would happily sit on a free tier somewhere else
Ah, understood. Thanks
I use Supabase
Theo and other influencers single handedly convinced an entire generation of developers to be scared of self-hosting anything.
Yes omg, I was surprised reading through these comments recommending self-hosting. I can't let Theo limit my potential anymore
Just go for it dude, you'll be surprised at how much of a non-issue it is. They make such a big deal out of it which for the majority of people just doesn't apply
Exactly. Neither can I. We on this together lol
But you are telling everyone to self host your projects, without actually giving any advice of how to do it, that just seems really strange
What a weird comment. Google is free and if you or anyone else has *specific* questions I'm happy to answer them.
My point is just that you are pushing it so hard without actually helping anyone.
What do you expect from me? Be specific
That's because self-hosting your own database is a shitstorm waiting to happen once you get more than 1 user. Security is a big deal, and handling it on your own is far from being a smart move.
Honestly ive struggled to find a straight answer of what self-hosting means, can you help provide an example? Edit: to clarify, are you referring to something like running a docker container on a cloud server vs something like supabase? or what do people mean when they refer to self-hosting
The former is self-hosting. Supabase is a managed service
Ah got it makes sense, thanks!
Self-hosting normally means spinning up and managing your own database server.
Amazon Lightsail had some pretty cheap managed databases. I think you can get one for $10-$15 a month. Or spin up a digital ocean droplet and self host a MySQL database.
Just caused no one mentioned it, Convex DB is great. Has a generous free tier at 0.5gb and is setup as a database service using Amazon RDS. [Convex DB](https://www.convex.dev/) Edit: storage amt.
The free tier has 0.5 gb not 50gb but it is some next level stuff. Love using it, also their paid plan is completely reasonable
Agreed, thanks!
have you looked at supabase? could be a good fit, not 100% sure on current pricing -- pricing for production use-case may get pricey as well (given the price points you mentioned)
Full disclosure, I'm head of product at Xata (https://xata.io) 👋 We are building a data platform for PostgreSQL that you might find interesting. Our serverless architecture allows us to provide a pretty generous free tier with a few additional capabilities required for application development such as file attachments (storage) and full text search. We see production applications use this tier regularly and upgrade as they scale. Our TypeScript SDK also pairs quite well with NextJS. If this sounds interesting and you have any additional follow up questions, we're always around in discord https://xata.io/discord Best of luck in your search for an alternative to PlanetScale!
Appreciate you taking the time to leave a comment here :)) I'll for sure check it out, thanks!
Rolf, it seems that new web devs are literally unable to self host anything. Learn the power of self hosting.
Self host anything except databases! Unless you setup automated backups, scaling, replication, observability / monitoring and security auditing etc it’s better to use a managed service!
[удалено]
As a web dev, I'd much rather be responsible for a self-hosted database, which is basically just an install and knowing how to connect, than a web server, which is bunch of moving parts, especially with node apps...
Yeah, unless you really know what you are doing, you should probably use a service like planetscale, supabase, turso, railway, neon, etc.
No, just no. So much fear mongering around self hosting. Majority of people don't need all that except for automated backups which is easy to set up yourself. And any VPS provider easily allows you to scale vertically. All of this can be solved without hiring dedicated engineers or spending 120K a year like some youtubers want to make believe.
they are doing a tech demo hackathon for 100 people. who the f cares about all that.
why? i can extract the time efficiency of using something like supabase and put it into my business instead
I've self-hosted a few DB's in my time and it has been a PITA 85% of the time with no real benefits. the only time I will do it is if a client really has to or needs to have their DB on their own infra for some reason. and in that case I will ask them to provide it themselves.
Really? What made is such a PITA? I have DBs that ran for a decade with little issue or effort. I think a lot people have problems when using it with docker, as docker will get bad overtime and run unstable. If you run it bare metal, no problems.
Well, I'm by no means a DB expert, and not very knowledgable in DB mgmt, so: - Having to manage creation of backups/snapshots and the safe storage of those backups/snapshot - recovering backups/snapshots - Scaling, replication, etc - updates and upgrades - user mgmt - tweaking for performance - security You know, the usual things a DBaaS will handle for you. I don't need to perform those things often, usually only at the onset of a new project, so I don't gain lots of knowledge about them and know just enough to "get by". And these things don't interest me either. I usually work on a team of developers in a company that builds software for our clients and if those clients have a budget that can fit a DBaaS (usually a few dozen dollars a month) with all the facilities and ease of use that it provides, and if it fits the client's requirements for where their data is allowed to go, we go for a DBaaS. > as docker will get bad overtime and run unstable Now that seems strange to me. The DB's that I do 'self-host' are in Docker together with an API and a reverse proxy on an EC2 instance, for example, and they're usually up for months at a time, only needing to be brought down to upgrade the OS on the EC2 instance and such.
Yeah, months. Not years. Usually you destroy and rebuild the containers. Ok, if you are building it for clients than I understand. It's faster, but it not as difficult as people make it out to be. Having basic knowledge of how to set up databases should be a part of fundamental education of any fullstack web developer. So many developers have never touched bare metal, that they literally got the rug pulled from under their feet when Planetscale stopped their free tier simply because they have never setup their own database. If you are looking it from a time constraint and are not paying for all the servers, then I agree. But if you are doing your own projects and have to pay for everything yourself, then self hosting can be beneficial as it gives you an alternative to vendor locks, be it aws dynamo or mongodb.
Personally, I haven't tried doing this yet but I keep hearing that you should definitely avoid self hosting until you REALLY know what you're doing. It felt more efficient to go with a provider and just focus on the stuff that matter with the time I save. But I don't exactly like the idea of how things are so abstracted away from you nowadays, so I'll definitely give self hosting a try eventually!
You know who benefits the most from pushing that fear mongering narrative that self-hosting is scary? Influencers and providers. It's not scary or crazy difficult to host your own services, in fact that's what we've been doing before all these \*aaS companies came along. Heck, installing XAMPP was literally the first thing we did in school when I just started learning software development.
If you don't host sensitive info and don't have money for a paid cloud db, just buy a vps and host it yourself. Just buy 5$ vps from digital cloud and play with it.
If you never self-host anything, you'll never REALLY know/learn what you're doing, and be stuck using, and paying for, managed services forever.
Can’t emphasize this enough. It’s not that hard. Learn CDK in aws, and you get full flexibility
People who know how to stand up backends using the AWS SDK or CDK make very impressive salaries. It is not realistic to just expect everyone to be able to do that, its the whole reason this class of service exists. So devs can avoid direct contact with AWS who want to.
[удалено]
[удалено]
[удалено]
What’s the point of building something from scratch if you can’t do it better than the services that already exist? Do you really think a team with 5, 10, 20 people can outperform an entire company that is dedicated to that resource (db, auth, etc…)?
Yes, because you don't have to rely on a third party for everything.
“Everything” is too broad. Auth, databases, CMS, ERP… those aren’t things you can easily do with security, scalability, flexibility in mind, at least in a timely manner that doesn’t prevent product shipping.
The problem with that argument is the following: A cook can probably cook better than you, so why cook? You can extend it to everything till you rely on everything for everything. And that’s exactly what we are drifting towards too. Many people don’t have a basic skillset anymore. Many devs can’t setup a database, a lot of devs don’t even know what NVMe is and so on. We are collectively getting dumber and we enjoy it. We will see the price we pay once we are fully reliant for everything. Fits right into the WEF saying: “You will own nothing, and you will be happy”. Are you friends with Klaus Schwab by any chance?
Lacking the skillset has nothing to do with how the company you work for structures their business. Having third parties is no excuse for the lack of skills. Also the cook analogy would be fine if creating a database would be the equivalent of smashing two lettuce leaves together
Cooking is more than lettuce, but I guess that fits well into the conversation.
Supabase :)
I mean, the easiest is to just spin up one EC2 t2.micro (free tier) and host your database there. It's fast, easy, especially if you're using it for a hackathon. You have every control you could ever need. And it's probably replicable (very close) to what your local development environment is—easy to debug if things go wrong. Even if not for a hackathon, self-hosted database servers are common in production apps, too. >would lead to a more valuable learning experience Also, self-hosting your database server will definitely give you a valuable learning experience in hosting *literally anything*.
Alternatively, for a low-traffic website, a very small RDS instance is about $15/mo, and you’re less likely to accidentally delete all your data.
RDS is a great choice, even for large apps with big, very big databases (future-proof)! But of course there's a small learning curve (like literally every AWS service), and that it's still a *managed service*. But one gets many database ops feature for free (well, not exactly free since you paid for it, but you get my point). If OP is scaling up real quick, they can consider RDS. If they only have 1 hour before the app launches and need to deploy, I think ~~you need to wake the hell up~~ EC2 is a cheap and dirty solution, since if you've set up your database locally, you can set up your database in EC2.
Thanks! Self-hosting seems like an amazing learning experience after reading through all these comments. But it's something I would try out on a personal project for learning purposes. I feel like it's a risk to introduce it to a team full of new developers. They may end up learning less or get demotivated if the learning curve is too much.
I have seen many people migrating to turso, you may try it
You mention its an hackaton, so its something that will be very short lived? a few days at most? In that case, maybe using something established like AWS RDS or GCP Cloud SQL where you pay only what you use? And maybe you can even get some credits for new users. You can specify quotas and limits for usage I believe, so you could avoid a big bill by mistake This can become expensive if running 24/7, but for a few days, I think it can be a great option. You could also look in Digital Ocean Managed database services, for example
It's actually the main website for the hackathon itself, so we'll be dealing with hundreds of user registrations plus have other social media like features. I've made a whole bunch of full-stack applications as personal projects but never had over 30-40 users. So I was just worried about what happens if there's a hundred or more users. But after reading through the comments, seems like it's not something I should even have to worry about. Thanks for suggesting the quota limit. This is something I didn't know when setting up a database with GCP in the past, and then accidentally kept it running for 11 days lol
100 or more users should not be a big deal 👌🏻 Just whack it on supabase if you want a paas with auth built in or railway if you want quick easy and autoscalable. The latter has a lack of things like backups though I believe.
AWS RDS is pay for use? Are you sure?
https://aws.amazon.com/rds/pricing/ "Amazon RDS is free to try and you pay only for what you use with no minimum fees." And also checked their calculator and you can specify the number of hours per month.
you should be able to handle more database connections with connection pooling. im not sure what the read/write limits per second are on planetscale.
You don’t need 100 db connections for 100 users. Regardless of where you deploy to each connection can serve more than one user because whatever is connected to the db (either a serverless function, or a docker run instance of nextjs) can handle much more than one user at a time.
That's good to hear🙇♂️ one of the backend devs on my team brought up the concurrent user issue and that was one of his biggest worries.
If you spin up a server based api you don’t have to worry about connections at all as you will effectively just be using 1. So you can just do that instead of serverless if you are concerned.
Supabase
MongoDB 🥱
I'm curious how DynamoDB would compare price wise. It could definitely handle the traffic, but the cost might not be comparable
This news sucks for sure. I decided to try out the Vercel Postgres since I'm already paying for Pro. Seems to be working well so far after doing some db dumps from planetscale and running the SQL scripts manually to move data over. So, might be worth considering if You're already on the Vercel ecosystem.
I'd like to hear some suggestions on what provider to use that plays well with Cloudflare Workers. PlanetScale had a nice lib for that but for my use case their paid plan is an overkill, can't afford that.
oh man. 100 users? literally anything. google sheets. anything can handle 100 users. but seriously, just run sqlite somewhere.
neon &/|| cockroachdb
Like others have said, Supabase is a good alternative. It's Postgres underneath but if you use Prisma, your migrations should still work with pg. You may have to change up some datatypes and you'll probably have to change your datasource in `schema.prisma`. Other than that, it shouldn't be much of a change since most of the database handling logic is managed by prisma.
Why? Why all this? Honest question. Why don’t just go with a good old vps?
Vercel have made Next a nightmare to host outside of these fucking edge environments. You've gotta hack around with middlewares to get access to Node APIs and enable experimental features. It's no surprise people are leaning towards these environments.
Unfortunately, I was expecting your last sentence to be "It's no surprise people are leaning towards other frameworks"...
That is true as well
Can you suggest some? I just got oracle cloud free tier to learn/test for the first time. Trying to deploy nextjs on an instance there but unable to find a good resource.
DigitalOcean is very popular and well recommended. I keep hearing about Linode as well but I haven't used them.
I have a good feeling about DigitalOcean. Will check it out. Thanks
If you're looking for free, you might not find any. AWS might be a choice, though as far as I know their "12-month "free tire" doesn't actually cover a full time month each month. Of course. If you're looking for paid solutions, u/soggynaan got you :)
I saw AWS. They also provide lifetime free Lambda. Thanks for the suggestions!
Thanks for the mention u/doobltroobl Also, I forgot to mention but here's a great website for comparing Cloud providers: [https://getdeploying.com](https://getdeploying.com) But u/Redicus as you said in another comment you're feeling good about DigitalOcean, well the good news is that with a VPS you often only pay for what you use. So you can spin up a $4 VPS with DigitalOcean and use it for let's say 48 hours to learn the ropes, and destroy the VPS after, you'll only pay for those 48 hours you've used the VPS for which will be just $0.28! This allows you to not be chained to just DigitalOcean, as you can try out different providers until you're satisfied and only pay for the time your VPS was active. Compare that to PaaS/IaaS like Vercel, PlanetScale, etc, you gotta pay for the whole month in advance even if you don't use it to full capacity. But honestly if I were you, I'd stick with that Oracle free tier or AWS EC2 free tier **strictly for learning purposes** and not hosting anything business-critical (especially not on Oracle). Heck, you could even use a spare pc/laptop with Linux installed or a VM on your main PC to learn, which is what I'm currently doing (Debian VM running Proxmox locally and treating it as a remote environment). GL!
$0.28 for testing is very cheap, thanks for the suggestion! As for Oracle, i am unable to get the free Instance as its reached capacity. Its been like this for years. The only shape i could get is a Micro instance with 1GB memory and 0.6Ghz CPU which crashes if i install any package on it. Will keep in mind not to use it for important data thanks!
Because the existence of such one click deployment has made people too comfortable... Whipping up a vps, configuring it and hosting a DB in it live and managing it has been abstracted to a point that the new gen doesn't EVEN KNOW what that means....
You shouldn't have anything to worry about. A couple things: 1. Your server shouldn't be using one connection per user. In fact prisma defaults to 2 * num_physical_cpus + 1, so depending how you're running your app you shouldn't be using more than 20 or so connections (max). If you HPA in k8s and have e.g. 10 pods each with <= 1 cpu, then you would only have 3 * 10 = 30 connections max. And even then, that's an upper limit on connections. If a pod isn't serving much traffic, it may not need to open more than one connection 2. The limit is actually 10,000 connections in Neon assuming you set pgbouncer=true on your connection string. This is independent of plan, and true for free plan as well. https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool https://neon.tech/pricing
Presumably he’s using vercel to deploy his next app on a hobby tier given that he thinks $40 is a lot of money to spend. That means serverless, which means Prisma isn’t going to be pooling connections since concurrent requests are going to spin up new serverless functions with new Prisma instances.
So Prisma would actually lead to more database connections being made? Would Drizzle do any better? Or should I consider writing raw SQL?
It’s not a limitation of Prisma, it’s a limitation of serverless architecture. If you end up using a product like planetscale or neon that have proxies set up for you you don’t have to worry about the issue if whatever lib you choose can connect to that proxy endpoint.
If that's an issue, you can also get a non-sleeping free instance on koyeb with (I think) 0.1 vCPU and 512MiB. That's a container running and you won't have any connection concerns. It's very easy to set up if you're coming from a vercel app.
Yeah good point. Depending how many requests he's serving I would guess that the lambda functions would stay warmed up and he wouldn't see a large number of containers backing the functions - and with a 10K limit on neon there's almost no way he has any issues even with connections being left open etc. But I also forget if vercel spins up a separate lamba for each API function or a single lambda. If the latter then he'd still be fine.
Thanks so much for this. It clarifies things down a lot further. When I was first told about how I should watch out for connection pooling, I was told that every new user is a new connection. But they were also a junior developer so maybe they were wrong to an extent. NeonDB sounds like a really good option now!
you can quite literally serve "a few hundred concurrent users" via a very simple postgres/mysql server in a cheap vps (20$ would be my guess)
[удалено]
If your app is just a run of the mill crud basic app then sure, $5 is more than enough.
Does anyone have experience with digital ocean postgresql hosting ? Would you recommend it? I think it's a 15$ plan
It is really good
Turso
Convex.dev
Really small storage size tho. I’ve used convex before but many people seem to like it a lot. Their free tier is meh. What are your thoughts on it?
DigitalOcean droplet 8GB 4cpus 80GB SSD $48/mo install Directus BaaS from DO Marketplace, Portainer cloud free, frontend Next.js 14 use REST deploy on Netlify with Edge Functions. 200k users no issues.
Railway is great
If you are saying a hundred people at peak just use crunchy data and a aws instance. You can get a 10 dollar DB which can likely easily handle that load. If it can't you can get double the power for double the money
Say goodbye to DBaaS, your data are locked and kidnapped, self-hosting is not that difficult.
Imagine that you can self-host database on ANY hosting for... 1$ / month :) Crazy, right?
neon is probably your best bet for free, i wonder what happened to planetscale that they had to just kill off their entire business overnight
I'm a little lost as to why this even matters. You could isr a production grade DB for your hackathon from a CSP like AWS or GCP for the time you need it and then delete it. Most hackathons I've done last 2, maybe three days. Do the hackathon, dump the data, and then export it back. Or just store it in BQ - nearly same cost as gcs/s3 but with significnalty better usability and reliability. Better idea: see if you can get sponsored! Also: GCP has $300 in credit for new accts. Other CSPs may have similar offers. That's bettrr than Free Tier IMHO as you can decide to keep - or not.
It's actually not for a hackathon project by for a hackathon itself, the main website for the hackathon where hundreds of people would be applying and stuff. Plus other features that make it more of a small social media like application. That's why it mattered. I'll see if GCP offers something for students! But I didn't hear anything about the $300 credits for new accounts. And yes, as we get sponsors for our hackathon, we should hopefully receive some funding that can go into the tech side of things!
just use sqlite + wal mode. if sqlite doesnt work for your usecase, use mysql + postgres self-hosted. it ain't that hard & if the db goes down, just use a much beefy server. $10/mo should be easy to host. use my solution if you want (sqlite + litestream + docker) -> https://github.com/deadcoder0904/easypanel-nextjs-sqlite
I'm in a somewhat similar position... Although, I only just released my product this past month with Planetscale (only 200 users at the moment) and it's just a small hobby project not making any revenue, so not wanting to spend $40+ dollars a month. I feel I could justify the $20, but $40+ is a bit steep. So I need to migrate to another MySql solution. I'm thinking Railway, however their region support isn't great. My users are in UK & Ireland Railway's closest region is Amsterdam. Which isn't ideal. I see a few have mentioned self-hosting, which I think is a great solution if you have a bit of experience with it, unlike me. I don't mind paying for the convenience of handling the things I don't even know that I need to handle that managed solutions do for you. Like need to look into handling backups, switching my logic in some of CI/CD pipelines for e2e testing I currently have with Planetscale, so the mental overhead and additonal time required to learn these extra things I'm not 100% sure is worth it for me, at this time anyway. Unless someone has a really good tutorial or article going over some of these things on a self-hosted, then I'd maybe consider it.
Planetscale is great. Just putting that out there in case anyone reads this title and thinks negatively about it
They just cut their free tier, so this will be a common question, since the lowest price is now $40pm
Oof. I was unaware. Thanks
Another option you could check out is Koyeb Postgres. It runs on Neon and gives you 1 free managed postgres database to run. The paid instance are charged by second making them much more affordable.
Tech.neon