Live data from Hacker News

Just use Postgres

mccue.dev

171–180 of 238 posts

Re: Just use Postgres

#171

These posts are always so biased to the person that's used postgres 100x more than any other DB.

Absolutely this. The author seems blind to Postgres shortcomings.

For example, the author notes MySQL has "features locked behind their enterprise editions." That is true for some features in MySQL, yes. But the same thing is true in Postgres for DDL logical replication and other HA-related features, which are only in EDB Postgres -- and yet those are features MySQL has had in open source for over two decades.

Re: Just use Postgres

#172
post #169

Almost all statements about MongoDB are wrong. > You know exactly what your app needs to do, up-front No one does. Mongodb still perfectly fits. > You know exactly what your access patterns will be, up-front This one also no one knows when they start. We successfully scaled MongoDB from a few users a day to millions of queries an hour. > You have a known need to scale to really large sizes of data This is exactly a g…

> We successfully scaled MongoDB from a few users a day to millions of queries an hour. Uh, 1 query per second is 60x60x60=216000... Soo, 1 million queries per hour equals 4-5 queries per second. Soo, that's not even at toy project level. That's extremely low scale, like the smallest possible instance small. A consumer laptop does 20+k queries/seconds on postgres, mysql etc. a raspberry pi usually still gets 1-3k rea…

60x60x60 is 60 hours, not 1 hour. 1 hour is 3600 seconds. therefore 1 million queries per hour equal ~280 queries per second.

Re: Just use Postgres

#173
post #169

Earlier quoted context omitted.

> We successfully scaled MongoDB from a few users a day to millions of queries an hour. Uh, 1 query per second is 60x60x60=216000... Soo, 1 million queries per hour equals 4-5 queries per second. Soo, that's not even at toy project level. That's extremely low scale, like the smallest possible instance small. A consumer laptop does 20+k queries/seconds on postgres, mysql etc. a raspberry pi usually still gets 1-3k rea…

60x60x60 is 60 hours, not 1 hour. 1 hour is 3600 seconds. therefore 1 million queries per hour equal ~280 queries per second.

Oof, you're right. Still within the performance profile of a raspberry pi though, even if it's no longer off by an order of magnitude

So I think my point still stand: that number is as low as you can get for any rdbms.

Re: Just use Postgres

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

Postgres isn't hard to use, but it requires maintenance. You need more scripts, more tooling, more knowledge of DBA, and that may not be necessary. When you're using a database to store a few thousand rows of data, Postgres quickly becomes overkill. Postgres is a V8 engine when all you may need to power is a lawn mower. I personally prefer to use abstractions like ORMs for most of my database interactions, and direct…

> Postgres isn't hard to use, but it requires maintenance. You need more scripts, more tooling, more knowledge of DBA, and that may not be necessary.

I don't think Postgres needs to be maintained at all for small databases, which is usually the use case for SQLite. Their default configurations would take care of most things for trivial applications.

> Starting an application with a temporary in-memory database is a lot faster than starting a full container.

Starting a container might be way slower than SQLite, but I would still consider it fast for most, if not all use cases.

> hooking up a Postgres account

You can configure Postgres to start up in trust mode, which doesn't require a password for any user. This is basically the same as the unencrypted SQLite database file but with a fixed connection string: `postgresql://postgres@localhost`

Re: Just use Postgres

#175

Earlier quoted context omitted.

> 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…

> 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. This is why everyone uses docker and .env files. The problem has already been solved and you can copy/paste starter files from project to project to make it a non issue.

Well running dbs in containers are generally not a good idea.

Re: Just use Postgres

#176
post #108
post #79

Earlier quoted context omitted.

sure. 1. sqlite can have more than 1 file when using wal mode. 2. You don't need to know your exact dyanmodb access patterns upfront, you can evolve the schema. again, not worth effort to point out more.

Denormalizing data always locks you into certain access patterns, regardless of your ability to evolve schema.

DynamoDb is not a distributed hash map, it is a distributed forest of B-Trees. And B-Trees are what PG uses for indices and MySQL for both tables and indices. You don’t demoralize with it, but rather you build and maintain table and index like structures, they would contain submitted of ids or other data fields but it is the same with normal DB indexes. The difference if you have to maintain them manually. The upside is scale, serverlessnes and maybe less latency.

Re: Just use Postgres

#177
post #169

Almost all statements about MongoDB are wrong. > You know exactly what your app needs to do, up-front No one does. Mongodb still perfectly fits. > You know exactly what your access patterns will be, up-front This one also no one knows when they start. We successfully scaled MongoDB from a few users a day to millions of queries an hour. > You have a known need to scale to really large sizes of data This is exactly a g…

> We successfully scaled MongoDB from a few users a day to millions of queries an hour. Uh, 1 query per second is 60x60x60=216000... Soo, 1 million queries per hour equals 4-5 queries per second. Soo, that's not even at toy project level. That's extremely low scale, like the smallest possible instance small. A consumer laptop does 20+k queries/seconds on postgres, mysql etc. a raspberry pi usually still gets 1-3k rea…

Your math is wrong… and it cannot be assumed that traffic is uniformly spread.

Finally what you’re saying is orthogonal to MongoDB - you can self host Mongo on a raspberry pi.

Re: Just use Postgres

#178
post #108
post #79

Earlier quoted context omitted.

sure. 1. sqlite can have more than 1 file when using wal mode. 2. You don't need to know your exact dyanmodb access patterns upfront, you can evolve the schema. again, not worth effort to point out more.

Denormalizing data always locks you into certain access patterns, regardless of your ability to evolve schema.

You do not have to denormalize data to use dynamodb, just like how data doesn’t have to be normalized to use a relational DB.

Man people have no clue what they’re talking about lol

Re: Just use Postgres

#179
It has never made sense to me why someone uses no, and then proceed to little by little to make their implementation into having relations.

It’s way less work just to learn sql or an orm.

Nosql is great at being a document store.

I’ve used MySQL longer, it’s been a good default option, the jump to how Postgres works and what it offers is too much to ignore.

Postgres can act as a queue, many of the functions that a nosql has, handle being ann embedding db, and do so until a decent volume. It can be the backbone of many low code tools like supabase, hasura, etc. the only thing that’s different is there seems to be nice currents for MySQL but you get the hang of it pretty quick.

Re: Just use Postgres

#180

Earlier quoted context omitted.

Fully agree. At that level, the justification for using MongoDB usually boils down to not wanting to deal with table schemas or SQL. In both cases, there are better alternatives.

I’ve heard stuff like this from supposedly senior people - if we use mongo we can just store anything, we don’t need to think about a schema (also you can only store short strings in an SQL database)

If we don’t think about it now we’ll really have to think about it way more later.
Post reply on HN