Live data from Hacker News

Just use Postgres

mccue.dev

61–70 of 238 posts

Re: Just use Postgres

#61
post #38

When people say "Just use SQLite. It's almost as good as Postgres and you won't need anything more" I'm trying to understand why I shouldn't just use Postgres. It's not like it's hard to install or has any significant overhead. Please enlighten me.

> It's not like it's hard to install or has any significant overhead.

Depends on the environment or lack thereof, postgres is a pain in the ass on windows, and then you need support for software configuration so that it can talk to postgres, and then you have to take care of the features you're using.

If you're deploying a complex server-side system with lots of moving parts, then yes postgres is basically free. But if you're deploying client-side, or want to run it in a VPS, or whatever, postgres might go from not available to extra cost to a huge chore.

> Just use SQLite. It's almost as good as Postgres and you won't need anything more

Can't say I agree with that sentiment in any way though, every time I use it sqlite frustrates me in its limitations compared to postgres, and how weak the defaults are from a safety and consistency perspective.

Re: Just use Postgres

#63
post #10

It's not worth pointing out the technical flaws in the post[1]. It is obvious the author does not have a strong grasp of the tools he is criticising. A better example of this style of post is Oxide's evaluation[2] for control plane storage that actually goes over their specific needs and context. [1] Ok, just one, Rick Houlihan is currently at MongoDB. [2] https://rfd.shared.oxide.computer/rfd/53

> It's not worth pointing out the technical flaws in the post[1].

It might help your argument if you pointed out a real technical flaw in the content of the post, and not an example of the author being mistaken about a stranger's first name.

Re: Just use Postgres

#64
From the article, DynamoDB-likes are good IF:

* You know exactly what your app needs to do, up-front

But isn't this true of any database? Generally, adding a new index to a 50 million row table is a pain in most RDBs. As is adding a column, or in some cases, even deleting an index. These operations usually incur downtime, or some tricky table duplication with migration process that is rather compute + I/O intensive... and risky.

Re: Just use Postgres

#65
post #38

When people say "Just use SQLite. It's almost as good as Postgres and you won't need anything more" I'm trying to understand why I shouldn't just use Postgres. It's not like it's hard to install or has any significant overhead. Please enlighten me.

SQLite for embedded or desktop apps.

Re: Just use Postgres

#66
post #38

When people say "Just use SQLite. It's almost as good as Postgres and you won't need anything more" I'm trying to understand why I shouldn't just use Postgres. It's not like it's hard to install or has any significant overhead. Please enlighten me.

Go with Postgres. SQLite is somewhat barebones, you are getting like 5 datatypes grand total with it (counting null as separate type), 1 type of indexes, somewhat unexplored tooling around it. Also column type is not strict and you can write strings into integer column. With Postgres you are getting very established and rich ecosystem, with various and VERY optimized data types, indexes, extensions (like postgis), tooling around it, lots of tutorials how to fix it if something goes wrong.

P.S. but if your project don't need any of that, e.g. it's desktop audio player, just embed sqlite - remove another subsystem to care about

Re: Just use Postgres

#68
post #22
post #7

Earlier quoted context omitted.

With Pglite it should now be possible to have the cake of Postgres' rich functionality and embed it too

*in nodejs (for now)

Famous last words, but it's already in a Wasm module and only needs a bit of glue code, so how hard could it be? :D

Re: Just use Postgres

#70
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.

> Missing sqlite comparison point: data types. SQLite is like JS with column datatypes, except even looser.

Also defaults:

- sqlite has STRICT tables, you have to opt in, per table.

- sqlite does not check foreign keys by default, you have to opt in, per connection.

- sqlite has WAL mode, you have to opt in, per database. And even with that you may want / need to add a fair amount of work to ensure you're not upgrading connections lazily (fecking SQLITE_BUSY).

Post reply on HN