Self-host database or pay for a service?

Do you possess operational skills?

Are you familiar with setting up Docker Compose with bridge networking? How capable are you with reverse proxies?

For inexpensive options, I recommend Racknerd’s Black Friday deals or Green Cloud’s budget VPS.

Make sure to set up your Postgres container in a bridge network that communicates with your web app container, then expose only the app container for security.

@Riley
I didn’t grasp much of that, so it may be more prudent to go for a managed service? Neon has been suggested by others, and I think I would qualify for their free tier. I currently use Render for my frontend, and it works well for free.

I’ve had great success with Supabase; I’ve yet to pay anything.

You might want to consider SQLite and use a persistent volume for simplicity.

Mackenzie said:
You might want to consider SQLite and use a persistent volume for simplicity.

I’m using Postgres based on ChatGPT’s recommendation as I may need to store JSON data.

Bear in mind that you likely won’t need horizontal scaling initially. It’s often a last resort if other strategies fail. Databases can handle vast numbers of queries effectively if the schema and queries are designed well.

@Jody
Should this lead me to self-host the database or pay for a managed service instead?

Just get an affordable VPS or even a shared host and put everything on there; don’t overthink it—keep it simple!

Rowan said:
Just get an affordable VPS or even a shared host and put everything on there; don’t overthink it—keep it simple!

Thanks. I’d still need to manage database backups on my own, right? As a solo developer, I’m trying to find the most straightforward solution even if it involves a $10/month service.

For $5/month, you can get a VPS from Hetzner that can host this and any other projects. Use Caddy as a reverse proxy to gain free HTTPS.

This package includes around 40GB of storage with unlimited traffic.

If you’re using Postgres, definitely consider Neon Postgres (https://neon.tech/).

Tatum said:
If you’re using Postgres, definitely consider Neon Postgres (https://neon.tech/).

That seems like the best suggestion; I believe I’d fit within the free tier.

MongoDB has a pretty good free tier if that interests you.

Self-host as much as you can. While cloud options are appealing, even minor usage can lead to exorbitant bills. If you scale on a service without a spend cap, you might face unexpected costs.

How large do you anticipate your database will be? Supabase uses PostgreSQL and is free until roughly 0.5GB.