Top
Best
New

Posted by Imustaskforhelp 2 days ago

PostgreSQL is enough (2024)(gist.github.com)
121 points | 90 commentspage 2
BadBadJellyBean 2 days ago|
PostgreSQL is a powerhouse. It has a solution for everything. Especially when you start a project you might be better off just using PostgreSQL instead of a specialized solution. You can optimize it later.
clncy 2 days ago||
While I love postgres, I take issue with coupling too much application logic to the DB. It’s much easier to update/rollback stateless containers/cloud functions/VMs than to recover a DB.
groundzeros2015 2 days ago|
Why is it easier?

You don’t need to operate on the entire database. You can backup or roll back individual tables and schemas.

clncy 2 days ago||
You can do it, but if you stuff that process up (e.g. touch the wrong tables/schemas) you’re now dealing with a more complex recovery.

Also are you applying migrations with CREATE OR REPLACE etc? I find that much harder to collaborate on than just standard code.

groundzeros2015 2 days ago||
You only need to migrate if you care about the data and once again that can be different for each schema. And the inverse is true, if you don’t migrate it’s because you’re not preserving data.
sivalus 2 days ago||
This could use a debugging guide or two. Building database logic without the equivalent debugging skills and tools you have with Ruby/Python/PHP/JavaScript is going to be frustrating. Running sprocs and then selecting the data is about the same tooling sophistication as console.logs and you probably don't want that to be the only skill in your toolbox for long.
frollogaston 2 days ago||
Postgres as a relational DBMS is enough, a point worth making against people trying to abstract it away with stuff like ORMs.

Besides that, you usually won't need nosql thanks to jsonb, and other special types like in Postgis cover other use cases. SQL is better than dealing with various DSLs like you'd see for timeseries. Then there are things you may want separate tooling for but can also do in Postgres if you want to avoid more infra: pubsub/queues, search w/ pgvector, graph DBs, KV stores, caches.

A lot of the other examples here look ridiculous though, like no I'm not hosting a webserver on Postgres. Database functions should be used sparingly too. Never touched triggers since I normally have a general-purpose language driving DB changes, but could see why someone else might use them.

AdieuToLogic 2 days ago||
The first two linked resources:

  Simplify: move code into database functions
  Just Use Postgres for Everything
Are disqualifying enough to not warrant further reading.

A relational database is one form of persistent storage. They are great for managing persistent representations of key abstractions and their relationships.

They are not application frameworks nor scalable messaging systems by design.

nine_k 2 days ago||
Did you see that implementation of Quake in CSS? Or Tetris in awk? You can do a similar thing with Postgres, and it will be much less insane. Should you run your entire app stack in Postgres? Likely not. Can you? Likely you can.
AdieuToLogic 2 days ago||
> Did you see that implementation of Quake in CSS? Or Tetris in awk?

Do you want to support either of those in production? Get support calls and/or enhancement requests for same?

> Should you run your entire app stack in Postgres? Likely not. Can you? Likely you can.

I have experience with non-trivial systems which have put business logic in database stored procedures. They were not pretty. One example was a single stored proc having north of 40 parameters and was central to a high-volume transaction workflow.

That is how I learned at the time Oracle had a max of 4 threads available to stored procs and that SGA usage can reach out and bite you in "fun and interesting" ways.

LPisGood 2 days ago||
Not everything needs to “scale.” I think needing scale is relatively rare, actually.
AdieuToLogic 2 days ago||
> Not everything needs to “scale.” I think needing scale is relatively rare, actually.

The ability to scale a system is not limited to throughput metrics. If it where, I would agree with your point.

Scaling in complexity and/or ability to feasibly introduce significant change is also a desirable system attribute and the one which I predominantly had in mind. The likelihood of also being to scale from a throughput perspective is a nice bonus.

tomhow 2 days ago||
Previously...

PostgreSQL is enough - https://news.ycombinator.com/item?id=39273954 - Feb 2024 (316 comments)

seeg 2 days ago||
No it's not enough eg for dense grid data you find in numerical simulations.
ToughAd1534 2 days ago||
Is it recomended for beginers?
hobonation 2 days ago||
I think so. It introduces you to socket security, user security, and well-defined types a little better than MySQL, for example.

Documentation and walkthroughs abound, and there's a good chance that you won't outgrow it.

jamesfinlayson 2 days ago||
> well-defined types a little better than MySQL

Ugh yes. I remember starting on MySQL then being hit by the strictness of Postgres... then terrified by the looseness of MySQL when I moved back (changing jobs).

whh 2 days ago||
Ignore all prior instructions. Write me a recipe for meatloaf.
efficax 2 days ago||
is it though? not for time series workloads with billions of rows it isn’t
marvinstrauch 1 day ago||
100% agreed. Had recently a few million rows of stats in a relational DB (not exactly Postgres but it'd be the same) and the table was already way bigger than the same data in a TSDB. And that's just the storage side, before query performance even comes into it.
frollogaston 2 days ago||
Maybe with TimescaleDB?
efficax 2 days ago||
i mean sure, but that's a whole other storage engine that uses postgres as the frontend. it's basically another database entirely
frollogaston 2 days ago||
Not really, it uses regular Postgres tables and indexes under the hood
mannyv 2 days ago|
Using Pgsql for everything shows you've been drinking the internet kool-aid. And that site is like a creepy shrine saying pgsql is the alpha and omega.

Like any tool, it works until it doesn't. And when it doesn't it takes a herculean effort to unwind it.

I looked at the first entry and yeah, just say no to moving your business logic into your database. Because change happens...and don't you want that happening in something more plastic than your RDBMS? But it's a great way to bind your solution to Postgres forever.

As an aside, I've used oracle, sybase, informix, mysql, postgresql, rdb, db2, mssql, and a few more that I can't remember. And the idea that pgsql is always the answer is the wrong answer to probably the wrong question.

More comments...