Ask HN: Why does HN adore Postgres so much?
Postgres is very capable and its support for SQL is very complete, but it’s also clunky and hard to manage beyond the simplest use cases. Setting it up in HA configurations is intimidating to the point that even experienced admins fear doing it for serious use cases and rely on managed Postgres at cloud providers instead.
Pg really feels like 1980s or 1990s “hand cranked” Unix software.
MySQL/MariaDB and especially CockroachDB and TiDB are alternatives that are massively more approachable especially in HA setups. Then there are NoSQL databases, graph databases, etc.
What is it that makes something as arcane and clunky as Postgres such a darling?
20 comments
[ 3.6 ms ] story [ 244 ms ] threadIt's not the case with PostgreSQL.
Using an ORM or not is a different question, nothing to do with either MySQL or Postgres.
2. Relative to their importance in 2023, HN disproportionately upvotes headlines mentioning Mozilla, Linux desktop frameworks (#1 recently!), and other technologies that were extremely important in 2003.
3. Based on that (imperfect) evidence, my hypothesis is that HN voters are heavily drawn from people who have been hackers for two decades are more *and who haven't fully updated their perspectives on software*. An implication of this hypothesis is that there are some topics which are underweighted on HN relative to their importance. I do not know how to test this hypothesis.
A form of 80's "sql" pushed out the more elegant upgrade for "sql". aka forerunner which postgress is based on.
"SQL" was a workaround to needing a degree(s) in underlying theory/how to build hardware/software from scratch and degree in practical use application(s).
Updated/modern 70's pre-sql , non-postgres example:
Kleene[0] / de brujin[1] programming a complete database system from scratch (pawk/neovim) using ebnf/bnf in place of more modern data structures with an wasm compiled awk /python for browser use might make postgres seem like a darling. Does make for lot of academic/discussion material.
[0]a : https://ai.dmi.unibas.ch/_files/teaching/fs16/theo/slides/th...
[0]b : https://www.cl.cam.ac.uk/teaching/0708/MathCompTh/kleene.pdf
[1] : https://en.wikipedia.org/wiki/De_Bruijn_graph
> CockroachDB and TiDB are alternatives that are massively more approachable
Maybe. CockroachDB claims Pg compatibility (though docs say nothing about extensions). TiDB has some interesting features, but MySQL compatibility scares me [2]. Neither of them has level of support from cloud providers that Postgres has.
Source: I work there. Feel free to join on slack and ask about your use-case.
I’ve recently started working on a concept for this kind of engineering: “zero interest rate architecture.” This would refer to designs that lead to huge recurring cash burn because you can always just raise more money.
It's okay to have different roles and responsibilities within organisation and it's okay to outsource certain aspects of operations. AWS RDS costs essentially the same for PG vs MySQL (PG is about 3% more expensive) and I doubt it would be much different in ops salary if you do it yourself, so it's not astronomical.
Edit: in case you're curious, part of the reason why I found it so difficult was because of MySQL's take on UTF-8 support.
MariaDB is not fashionable or high status.
People think they are making all these decisions on a rationale basis. But humans, including software engineers, are herd animals.
The drive to conform will push humans to do all sorts of irrational things. I still use vim (neovim) despite decades of hating certain things about it.
I think also that many developer's only real way of judging engineering is whether it conforms to certain stack or process patterns that they have heard of. Use the wrong stack or leave out some process and in their eyes you must not be a serious engineer. They aren't capable of or interested in looking into the details of the requirements and execution to judge you.
Configuring setups from scratch is always annoying. Checking out how others have handled/documented/automated HA setups is nice way to narrow down setup/understanding time. few search engine results: [2][3][4]
[0]a : http://wiki.postgresql.org /wiki/Community_Guide_to_PostgreSQL_GUI_Tools
[0]b : http://wiki.postgresql.org/wiki/Design_Tools
[1] : http://pgmodeler.io/
[2] : https://ubuntu.com/blog/postgresql-high-availability
[3] : https://www.postgresql.org/docs/current/high-availability.ht...
[4] : https://jfrog.com/community/devops/highly-available-postgres...
At some point complexity and lack of polish becomes indistinguishable from closed source. An open system I can’t use easily myself is not open even if the source is available.
Running HA Postgres is not easy and requires a lot of niche/specialized knowledge. But running one of the big commercial DBs back in the pre-cloud days required just as much specialized knowledge at the DB level. It required network engineers and Sysadmins. It was far from cheap to run at scale.
Per stated alternatives: look pretty clunky compared to DIY setup using HAproxy for awk language based webserver running on a raided/distributed pi cluster with various levels of fail over support. Directly implimenting just what need to get job done using programming language on top of a hardware solution provides for very lean/customized solution. Although, does assume very familiar with HW/SW setup and extensive familiarity of various stacks/programming concepts. SQL front end can be implimented in awk as a front end to awk.
"from scratch" issues:
Not exactly an actively suported specific DB area/db tools package (cockroachDB / TiDB / NoSql / graph DB, etc).
Not an actively supported turnkey database management system under common ide/environment (postgres, Oracle, etc.)
Flexibility limited to level of knowledge of various db areas/tools under common ide/environment (postgres, Oracle, etc.)