Live data from Hacker News

Just Use Postgres for Everything

amazingcto.com

1–10 of 30 posts

Re: Just Use Postgres for Everything

#2
I mostly agree with this...

> Use Postgres for Fulltext Search instead of Elastic.

Yea, that's not quite the same. Im going to make the argument that a well tuned search platform along side your data storage is probably one of the most useful things you can have. It's one of the first places where you will be "let down" by the Postgres solution.

As a document store, a queue, Postgres will do the job up to a point. When and where it breaks down in one of these ancillary roles you're likely to have the resource to support more systems, or a more "focused" tool.

Re: Just Use Postgres for Everything

#4
All of these points are valid, when given a caveat of "if Postgres covers your actual needs".

Like, I've personally worked on many systems that used Redis for absolutely no reason. As it was not actually measurably improving the latency of any part of the system. It was basically just another place to store data.

Obviously, Postgres and Redis are not the same, and there are situations where keeping data in memory at all times is important for latency. Hence the caveat. But most companies are not in any such situation.

Same story with the rest of these technologies - people often reach for them without really considering whether they are any sort of improvement over just storing the data in a relational database. This is commonly done by engineers who underestimate the capabilities of a relational database.

Re: Just Use Postgres for Everything

#5
As always, "it depends". There are situations where you can use Postgres as a queue perfectly fine. But there is no way Postgres can do as well or better than RabbitMQ in all situations. Same for text search, and so on.

Re: Just Use Postgres for Everything

#7
post #6

> Use Postgres for caching instead of Redis with UNLOGGED tables This is not the same thing, is it? Redis is in-memory, while the Postgres tables will be on disk, even UNLOGGED.

I thought unlogged was used so crash recovery would truncate / dump the table on a crash with 100% Dataloss but this let you put stuff on a tempfs / ramdisk?

Re: Just Use Postgres for Everything

#10
A lot of points made here is also is why I believe Phoenix framework is the BEST stack for building mvps in 2024.

1. you get concurrency and pubsub built in with no external dependancies.

2. postgres suppport out of the box. our entire deployment is just phoenix + postgres

3. creating a microservice is easy. create a genserver, add it to your application.ex -> DONE. no need to create a seperate repo. its already able to send and receieve messages from other parts of your monolith using the built in pubsub system

4. Oban, the background worker library uses postgres.

end result is that as a small team, we are able to knock out a lot of features and scale it without any of the complexity most startups have. Its been 4 years and only now we are starting to consider bringing in an external message queue.

Post reply on HN