How to create cheap database for a side project on AWS?

Since they didn’t mention managed, won’t hosting postgres on an ec2 make it cheaper?

You might be able to get away with local SQLite. Reads will be extremely fast, just make sure you are OK with it being tied to your app & persistence.
Another option is to use Supabase free tier (probably will be available for some time as is)

Could put it on a free-tier EC2 instance like a t4g.small — that should be more than enough compute power for a small DB

Why do you need a relational db if it’s only one table?

Dynamo is easily the best candidate for this.

It’s not an aws solution, but there are other managed db solutions like https://neon.tech/
Can’t vouch for it, but it has a free tier and if all you want is one table and a very low compute, it might suit your needs

“I’m not sure why it costs so much.” - because it is running 24 hours a day 7 days a week, and the price is based on the number of hours that that size of instance is running. Even a db.t2.micro will cost that much.

For my side projects, I install MySQL on a t2.micro EC2 instance (or even a t2.nano). Then I can stop it when I’m not using it, and it costs me next to nothing.

Oh I haven’t used lightsail till now. Will explore, thanks!

Ditto.

Unless you are doing something funky, Dynamo is be your cheapest option. Even if you ARE doing something funky, Dynamo is likely your cheapest option.

That said, don’t underestimate the value of your time to migrate.

Can you link to any setup docs for this? Also, there’s no resiliency if this single instance goes down right? Like you lose everything

You are paying on demand, so shutting it down when you are not using it will save you money every minute it isn’t running. If you don’t need the performance, you can switch the storage to magnetic storage and drop it ti 5GiB storage which would drop the storage cost to 50 cents a month.

and here I was using s3 like a fool

Have I introduced you to my friend SQLite?

can’t imagine a better solution than this tbh

DynamoDB with pay per request will basically be free for your case. RDS isn’t charging you per table or per request, they’re charging you for keeping an ec2 instance running 24x7.

Edit: I realize you said you prefer relational but there’s no “nearly free” for that. You could always use SQLite

Yeah you can no longer get rid of provisioned resources, which IMO means you by default can’t name it serverless.

OP has one since table that they are infrequently accessing. If it has a single unique identifier than his query isn’t complex, it is basically lift and shift to Dynamo.

For 1 table can you get by with S3 storage?

https://planetscale.com/

It’s not much cheaper but you can give it a haircut by switching to db.t4g.micro

For something at the scale I imagine OP is it at, you could probably just scan the entire Dynamo Table and the cost will be 2 cents in a decade.