Live data from Hacker News

What’s so exciting about Postgres?

changelog.com

71–80 of 137 posts

Re: What’s so exciting about Postgres?

#71
post #45

Earlier quoted context omitted.

I'm seeing this in action now, the difference between the backend code and the frontend code is stark and the backend code isn't up to my standard either (and my standards aren't that high, I know I'm merely competent for many places). It just seems to be the nature of the web side of things, lots of sloppiness. The devs are smart enough, they just don't think and it shows. That or they use something but clearly don'…

Hello fellow "merely competent" engineer. I recommend we both remove "merely" from our title. Inexperience grows from the bottom, I've gotten "better" by simply being too stubborn to get worse. Keep up the mediocre work!

> Inexperience grows from the bottom, I've gotten "better" by simply being too stubborn to get worse.

That is quite possibly one of the best quotes I have heard on how to approach discipline in engineering.

Re: What’s so exciting about Postgres?

#72
post #38

Earlier quoted context omitted.

PG steamrolls every other general purpose database, and has tons of extensions, and frontends so you can use it in any database paradigm. With 30m minutes of time, you can turn it into a document db, log/time series db, columnar, graph, key value, whatever

I bet we'd both seriously consider (if not prefer) sqlite over postgres in a bunch of scenarios?

sqlite is a wonderful, amazing, file manipulation API. If single-threaded file manipulation is what you need, its great. But is not an application backend in the way PG can be.

Re: What’s so exciting about Postgres?

#73
post #11

Databases shouldn't be exciting. They should just work . The main reason webcrap works is because the databases underneath work. If the Javascript crowd had to manage data storage, nothing persistent would work reliably.

> Databases shouldn't be exciting. They should just work . With enough experience with the alternative, things that just work are exciting.

Amen.

Re: What’s so exciting about Postgres?

#74

Earlier quoted context omitted.

That seems unfair. NoSQL was trying out new ideas in data storage. It was exciting to try out new or re-imagined core concepts, and some of those young projects had teething issues. But several are still around and remain popular, but they're popular for certain niches they excel at (and those niches were largely discovered through trial and error). In the SQL-sphere a lot of people skipped Postgres because MySQL had…

MySQL was also a lot faster in the early days. Plus it “just worked” not sanely mind you. But you had a lot less problems with type mismatches, up/downcast, etc. Well unless you wanted quality data. But back then we were just happy that it didn’t bother us with “minor” details.

It was a lot faster, and sometimes the odds that your data might live long enough for those integrity issues to matter seemed very remote.

Around 2001, the conventional wisdom was that it was worth the risk to take the performance victory, keep your hosting bill down, use mysql, and build some other approach to data integrity. (If memory serves, the integrity downsides were bigger then, too...)

The math is pretty different now. I'm not sure it's fair to hang all of it on Oracle, but it feels like that acquisition derailed some MySQL progress that might've made it a close call today. Now, I use Postgres unless I have a very specific, very compelling reason not to.

Re: What’s so exciting about Postgres?

#75
post #11

Databases shouldn't be exciting. They should just work . The main reason webcrap works is because the databases underneath work. If the Javascript crowd had to manage data storage, nothing persistent would work reliably.

  > If the Javascript crowd had to manage data storage,
  > nothing persistent would work reliably.
There are different incentives to writing UIs than there are when you're writing a backend. Often a business needs you to iterate very quickly, so people change their practices to suit this. Some are able to get away with never raising the quality bar once they finish iterating and it's unfortunate how the industry allows this. Additionally, there are, of course, teams and companies that want high quality code, but even here quality is defined differently from how it would be for data storage logic. For instance, it often means "high framerate" and "easy to understand", instead of "optimal" and "robust".

There are less JavaScript engineers writing backend code, and most that do this are generally making simplistic CRUD Node.js apps. However, there are companies and people that specialise in high-quality complex Node.js apps, and they try just as hard as backend engineers from other programming languages to do this well. (I'm thinking of projects made by developers on the core Node team. I've seen good backend code there, perhaps because they're more aware of lower-level concerns.)

I personally write a lot of JavaScript/TypeScript code and I try to do a good job, but a "good job" is defined differently depending on the kind of product you're creating.

Edit: I just realised you are _the John Nagle_, so you likely have a more refined taste in certain kinds of programming than I do, however I think my point about incentives probably still stands.

Re: What’s so exciting about Postgres?

#76
post #69

This was a really good article, and thank you @jerodsanto for submitting it. I learned probably 6-7 big things about Postgres reading it that I didn't know before. I won't list out those things, because, I'm sure it wouldn't be relevant to most people reading this comment. :). But, there are a couple things I noticed that I do want to mention: > There were these edge cases in there, where it’s kind of like less safe.…

> Most of that consists of MySQL being extremely permissive with what it allows you to do in your SQL. Many of those things are non-standard, and some are quite unsafe. Postgres not only prioritizes safety, it keeps the application developer honest. This is incredibly important: if you use MySQL, unless you are extremely pedantic about using safe defaults and a safe-by-default ORM you will almost certainly end up in…

> I've even seen a few cases where people had data loss which had either gone unnoticed or been sporadic enough that they assumed it was user error or random corruption.

I've gotten to troubleshoot this specific condition myself. Amusingly, the big thing that saved us was that we could use lingering redundancy in a poorly normalized schema to rebuild some relationships that should've been enforced by the database.

Re: What’s so exciting about Postgres?

#77

This was a really good article, and thank you @jerodsanto for submitting it. I learned probably 6-7 big things about Postgres reading it that I didn't know before. I won't list out those things, because, I'm sure it wouldn't be relevant to most people reading this comment. :). But, there are a couple things I noticed that I do want to mention: > There were these edge cases in there, where it’s kind of like less safe.…

Your example is outdated, MySQL doesn't truncate by default in later versions. Defaults can easily be changed. Choosing one database over another because of defaults is not a good strategy.

Re: What’s so exciting about Postgres?

#78
post #50

Earlier quoted context omitted.

SQLite is amazing, and “lite” is really not fair. I’ve seen it handle 1tb+ with at least decent performance. It’s not a replacement for a real DB but it is damn close.

It's not, because it is a real DB. It's just one for single user access only.

> Think of SQLite not as a replacement for Oracle but as a replacement for fopen().

https://sqlite.org/about.html

Re: What’s so exciting about Postgres?

#79

This was a really good article, and thank you @jerodsanto for submitting it. I learned probably 6-7 big things about Postgres reading it that I didn't know before. I won't list out those things, because, I'm sure it wouldn't be relevant to most people reading this comment. :). But, there are a couple things I noticed that I do want to mention: > There were these edge cases in there, where it’s kind of like less safe.…

Your example is outdated, MySQL doesn't truncate by default in later versions. Defaults can easily be changed. Choosing one database over another because of defaults is not a good strategy.

Fine, my example is outdated. That's irrelevant. I could probably find 3 more examples in the current default config for MySQL that would be as bad or worse.

As for the rest of your comment, sensible defaults most certainly are a valid reason to choose one piece of software over another. Bad default configs are equivalent to what the Dungeons & Dragons community calls "newbie traps." They're things that either don't look important, or don't look like they'll hurt you, but really are important, or can hurt you, if you're not extremely careful. What's more, some of these options are probably not going to be backward compatible with your code. So, you get into this situation where MySQL is doing shitty things you don't want it to do, and, when you find out later that it's doing those things, you either can't do much about it, or doing something about it involves major surgery to your application. That's bad.

So, yes, you can configure MySQL to have better than default behavior. That's no surprise; that's literally the point of having configuration options, after all. The problem is that some of these options don't look too bad. There is something to be said for having a permissive configuration. But, for the reasons I spelled out in the previous paragraph, that shouldn't be the default configuration. It's not too much to ask that you should be able to install and configure a database and not have it lose or corrupt your data.

Re: What’s so exciting about Postgres?

#80

Earlier quoted context omitted.

Btw, don't get me started about case-sensitive file systems - Windows got it right (case-preserving, but case-insensitive). Why should both /home/ellen/Music and /home/ellen/music exist? :)

Because once you go there, you have to answer questions which are not as easy. Does M match m? Does i match ı? Does a match あ? Does あ match ア? Does m match 𝓂? What happens when they need to coexist?

But they're different! I see where you're coming from though (unfortunately I know all these examples too well..).
Post reply on HN