Live data from Hacker News

PostgreSQL for Everything

raphaelbauer.com

161–170 of 286 posts

Re: PostgreSQL for Everything

#161
Funny. I was just this joking this morning with a colleague about using Postgres for everything.

Considering adding mongo for unstructured data? Just use postgres jsonb.

Building a search index? Postgres is fine too.

Considering using redis for fragment caching? Just use an unlogged table in postgres with key value columns. Need pub/sub? Well just use postgres listen/notify.

Using postgres for everything has served me very well.

Re: PostgreSQL for Everything

#162
These types of articles needed to be written because we have gone way too much in the other direction. The issue is that people use too many tools prematurely when they are not needed at their stage. So yea, in most cases, you are probably better off just with Postgres. I m a culprit of this myself so I wouldn't say that I know better. It is just too tempting to setup too many tools to feel cooler or feeling that "we must use elasticsearch as no one does search in db".

Re: PostgreSQL for Everything

#163

I love postgres and use it heavily, but I still don't fully understand how it overlook MySQL. Maybe because of Heroku adopting it. MySQL was generally faster, and while MyISAM was a bit limited Innodb was pretty powerful, and you had the choice. It was also simpler (imo) and avoided a lot of the xid/vacuum issues. That said, still love Postgres. But at the time it started eclipsing MySQL, MySQL felt better positioned…

Maybe things have changed, but my memory of MySQL ~15 years ago was that it was so... hacky. Basically, the (non-strict) JavaScript of the RDBMS world.

Re: PostgreSQL for Everything

#164

This isn't just theory either, for example: Revolut is a bank that does all its event persistence and streaming on top of postgres. No traditional message queues/brokers in their stack. https://medium.com/revolut/recording-more-events-but-where-w...

If you start here, with the "Postgres will take you wherever you need to go" meme, without thinking extremely deeply about your schema and how you expect to evolve it in the future, you can easily paint yourself into a very difficult and expensive corner. It's easy to use Postgres poorly in ways that result in painful centralized bottlenecks. (Obviously this is largely true for anything , but I think that in 2026, wh…

Having done that, e.g. used rabbitmq plus postgres, honestly I wish I had just used postgresql for both messages and data. It would have been easier to manage by an order of magnitude, especially at scale and needing to satisfy enterprise requirements. Also the flexibility of postgres would have solved problems that we ran into because of limitations of rabbitmq.

Re: PostgreSQL for Everything

#165

Earlier quoted context omitted.

You're right that vanilla Postgres doesn't come close to replacing Elastic. There are efforts to resolve this, though, like ParadeDB: https://github.com/paradedb/paradedb (disclaimer: I work for ParadeDB)

"Disclaimer" means "don't take this seriously because I'm not an expert". You mean "disclosure".

My English fails me again :'). Thank you for the correction!

Re: PostgreSQL for Everything

#166
post #150

Earlier quoted context omitted.

I mean, with this custom thing, you have that question as well with downside is you cannot pick up the knowledge from off the street. I became the Kafka guy at my current company, it took me about a week of reading and every time I had further question, I didn't have to bother anyone, I could Google and get data I needed. When it's some NIH thing, you have to bother coworkers and knowledge is whatever is in YOUR comp…

Yup, and every time it breaks, you've got to pester someone whose job probably isn't maintaining that thing actively. I worked at a startup with massive NIH syndrome, once. We even used our own in-house programming language, because it was "better than anything else out there on the market." It did have a lot of nifty features that others don't have: a pretty novel type system, programmatic macros, a built-in build s…

> e even used our own in-house programming language, because it was "better than anything else out there on the market." It did have a lot of nifty features that others don't have: a pretty novel type system, programmatic macros, a built-in build system and other fun bells and whistles

A DSL can work, but not for the features you list. Those features you already get from existing languages anyway!

If you need general programming language features like excellent type system, programmatic macros, a build system (doesn't need to be built into the language), etc... then use a general purpose programming language.

I have a DSL for backend/endpoints, and exactly none of those are in my feature list. What it has are things like easy way to specify access-control directives[1], the SQL query to execute, mapping request variables to SQL parameters, mapping SQL results-sets to response fields, etc.

I have another DSL for a test program. Both of those DSLs have specs that's literally 2x screens of bullet points and examples. LLMs can output those DSL programs because the spec for the DSL is so small.

For general purpose programming stuff (while loops, conditionals, etc) my DSLs break out to Python.

A good indicator that you shouldn't be creating a new language for production is when you find yourself implementing conditionals, loops, etc.

===========================

[1] Limit endpoint to specific roles, or members of the same team, or both, or even to the user itself - someone calling `/user/profile/update` should only be allowed if the profile they are updating is theirs, for example.

Re: PostgreSQL for Everything

#167
post #121
post #105

Earlier quoted context omitted.

100% except when Kafka goes wrong, who maintains it?

There are two sizes of companies: those that can afford '1+ dedicated ____-person' and those that can't. Which should filter through to technology choices more than it does.

Often you start as the latter and grow toward the former.

That transition can be super super painful as you don't quite have enough work for the dedicated person.

Re: PostgreSQL for Everything

#168
post #164

Earlier quoted context omitted.

If you start here, with the "Postgres will take you wherever you need to go" meme, without thinking extremely deeply about your schema and how you expect to evolve it in the future, you can easily paint yourself into a very difficult and expensive corner. It's easy to use Postgres poorly in ways that result in painful centralized bottlenecks. (Obviously this is largely true for anything , but I think that in 2026, wh…

Having done that, e.g. used rabbitmq plus postgres, honestly I wish I had just used postgresql for both messages and data. It would have been easier to manage by an order of magnitude, especially at scale and needing to satisfy enterprise requirements. Also the flexibility of postgres would have solved problems that we ran into because of limitations of rabbitmq.

And now there’s pgmq

Re: PostgreSQL for Everything

#169

Earlier quoted context omitted.

In a lot of cases using SQLite means you write queries incompatible with RDBMS. No need to worry about race conditions or the amount of queries you make, when 100 selects are uber fast.

Yes, for very small or embedded, single-purpose systems sqlite is usually a good choice. It's very well tested, and there's nothing extra to run or manage. But be careful if the system starts growing beyond that, you'll want a real RDBMS before you abuse sqlite too much.

Depends on what you mean by "small" and "growing".

If you mean database size, SQLite can handle massive amounts of data. I've seen 281 TB quoted as theoretical max size.

Post reply on HN