Hacker News new | ask | show | jobs
by jpgvm 1548 days ago
Unless you need realtime PostgreSQL is always the most obvious solution.

If you do need realtime you can build it on PostgreSQL yourself depending on your requirements either using LISTEN/NOTIFY or logical replication. There are tradeoffs to both if tbh if you are asking this question you probably don't want to go that path.

Non-realtime it's very easy to handle nested JSON in PostgreSQL but I would still avoid it like the plague unless it's user-supplied data without any real schema.

You might feel like schema-less lets you "move faster" but it's a load of horseshit that really starts to stink much sooner than you might think.

Schemas and by extension database integrity make it easier to move faster because migrations allow you to ensure there are no edge conditions related to stored data when upgrading your code to use an extended or otherwise modified data model.

The other main benefit of PostgreSQL is just the sheer body of resources available, with the exception of the other main RDBMS (MySQL/MSSQL) it just completely dwarfs what is available for other data stores. You will rarely if ever encounter a problem someone hasn't already solved.

2 comments

Use realtime from supabase https://github.com/supabase/realtime for realtime Postgres.

You can also use the whole package if you need a firebase alternative.

Yeah - Supabase would be my leading bet, if we had to pick a Postgres variant. Would be especially excited for their GraphQL plugin becomes ready: https://supabase.com/blog/2021/12/03/pg-graphql
> GraphQL plugin becomes ready

landing in ~2 weeks

Feel free to reach out if you need earlier access (my email is in my profile)

Supabase's pricing is $25/project/month. I wish it scaled with use instead.
I think it's okay. You don't want firebase pricing where they charge per operation.

They have a free plan which will work out okay for 99% of the hobby use cases. If you are beyond that, $25 isn't big ask for what they offer.

Check out Hasura as well.
> Unless you need realtime PostgreSQL is always the most obvious solution.

Or an easy HA setup...