Live data from Hacker News

Just use Postgres

mccue.dev

121–130 of 238 posts

Re: Just use Postgres

#121
post #28

> If you see a college student or fresh grad using MongoDB stop them. They need help. They have been led astray. I like this sentence way more than I should.

I don’t. How are new grads supposed to learn the ups and downs of different choices they make? Just being told they’re led astray in a blog post isn’t gonna work - it’ll backfire. I used node as a new grad for things it wasn’t meant for and that’s how I learned what it is good at and what it isn’t.

It's OK to use anything in personal or throw-away projects.

But if your choices might cause big losses, it's better to avoid experimental technologies.

"Nobody was fired for choosing IBM" is a known meme, but it's not just meme, it's actually solid advice (not specifically about IBM).

Re: Just use Postgres

#122
post #5

The "SQLite is just a file" thing is actually an advantage. The example of a website is actually a pretty poor one, since any website that needs to scale beyond a single box has many options. The two easiest ones are: - Mix static and dynamic content generation (and let's face it, most websites are mostly static from a server perspective) - Designate a writer node and use any of the multiple SQLite replication featur…

You don't need to maintain, secure and tweak postgres any more than you would with SQLite. Just install it and it'll work. Postgres backup is a single command. And actually you're supposed to create sqlite backups with special command as well, if you're copying a file, you're doing it wrong.

I really don't see any cons with Postgres over SQLite for server applications.

Re: Just use Postgres

#123
post #96

Earlier quoted context omitted.

except its factually incorrect when applied to Mongo[1]. [1] https://news.ycombinator.com/item?id=41273563

You can also shard with postgres, how is that a USP of Mongo?

I didn't say it is a usp for mongo. Only saying that there is a lack of substance behind the mongo criticism in the article.

Re: Just use Postgres

#124
post #9

Missing sqlite comparison point: data types. SQLite is like JS with column datatypes, except even looser. The claim about Datomic only working with JVM languages isn't right, it has a rest api there are eg python and js client libs using that.

> The claim about Datomic only working with JVM languages isn't right ...

TFA is also implying that it's either Datomic or Postgres but you can use Datomic on top of Postgres.

Re: Just use Postgres

#125
Personally, most of the projects i do are in self-hosted servers. The traffic isnt big. In such cases sqlite has been way better than postgres. Many times i see postgres not well used. Its meant for big project, not small ones.

Re: Just use Postgres

#126

Totally agree - I have tried many databases of all flavors, but I always come back to Postgres. HOWEVER - this blog post is missing a critical point.... the quote should be: ---> Just use Postgres AND ---> Just use SQL "Program the machine" stop using abstractions, ORMs, libraries and layers. Learn how to write SQL - or at least learn how to debug the very good SQL that ChatGPT writes. Please, use all the very powerf…

Great list of Postgres features called out that highlight the extensive feature set.

Most of these are covered in my book, for anyone that’s interested in learning them. The book uses a Ruby on Rails app with Postgres instances for examples and exercises. Hope the plug is ok here as some folks may be looking for learning resources for Postgres. https://andyatkinson.com/pgrailsbook

Re: Just use Postgres

#127
post #86
post #41

Earlier quoted context omitted.

> The "SQLite is just a file" thing is actually an advantage. It's more like besides the point. Everything in Linux is "just a file".

It can be a process and some unnamed sockets also, which is the main difference between PostgreSQL and SQLite.

SQLite is a library, the process still exists, it's just that it's part of your app now.

Re: Just use Postgres

#128
post #5

The "SQLite is just a file" thing is actually an advantage. The example of a website is actually a pretty poor one, since any website that needs to scale beyond a single box has many options. The two easiest ones are: - Mix static and dynamic content generation (and let's face it, most websites are mostly static from a server perspective) - Designate a writer node and use any of the multiple SQLite replication featur…

> if you use an ORM that supports both SQLite and Postgres you'll have the option to upgrade if your site brings in enough traffic

I'll never understand this idea that Postgres and SQLite are somehow interchangeable when the time is right.

My database and Postgres are _literally_ the core definition of everything that my application does. My app is written in Rust, but that doesn't matter because it's a _Postgres_ application. I use Postgres-specific features extensively. Converting the application to SQLite would be essentially a re-write, and it would be worse in every way.

Also, I generally just don't understand this fad of running production backends on SQLite. SQLite is great for what it is, a tiny little embeddable client-side database. But it is a _terrible_ database for non trivial business applications where ref integrity, real types instead of "everything is a string", and battle-tested scaling is essential.

Re: Just use Postgres

#129
post #15

Earlier quoted context omitted.

1) Fault isolation in case of hardware failure 2) You may not even be able to _think_ about using Docker (OS restrictions, airgaps to install images, etc.) These are just 2 that come to mind from working in regulated industries.

In this thread, we're making a comparison to running Sqlite. Fault isolation is not an argument. And you don't have to run Docker to run Postgres, it's just an easy way to do so. Even airgapped.

In my experience, people running airgapped systems prefer OS packages and prebuilt images rather than even considering doing Docker pulls

Re: Just use Postgres

#130
post #46
post #35

Earlier quoted context omitted.

> Rick Houlihan is currently at MongoDB. Not according to the YT video. AWS in 2018 I did not detect technical flaws in the article. I thought it was very good

[flagged]

Yeah, shit. Fixed that one.

Would you believe I don't have an editor?

Post reply on HN