4 ms·
While we are here. I know HN hates mongo. But lemme ask this question, what are the things in which mongo is better than postgres?
by InGodsName 8y ago
While we are here. I know HN hates mongo.
But lemme ask this question, what are the things in which mongo is better than postgres?
- anarazel 8y agoMarketing / Evangelism / Outreach. I'm not kidding, and I don't predominantly mean that in a bad way. I think it's something that the postgres community / companies really aren't good at.
- user5994461 8y ago+1 on that. It takes 80% of the work to build the product and 80% to sale it. MongoDB was really good at the later, creating and riding the hype wave.
- purple_ducks 8y agoSubtle data loss...
- h1d 8y agoI'm not trying to cover mongo but I hear stability has improved and random data loss is an old story.
- pritambaral 8y agoI'd rather go with the database that has never blatantly lied, especially about keeping my data safe.
- StreamBright 8y agoThe only database we lost data with is Mongo. We had support at the time but even them could not recover. Migrated to Postgres the next month and never looked back.
- astine 8y agoFor a serious note, there are occasionally situations where I have to take in a lot of data that I know nothing about. Sooner of the time this data is either in json or readily convertible to json so losing it into a mongodb database and poking around in it is a reasonable preliminary step to whatever the more permanent solution should be.
- kstrauser 8y agoWould PostgreSQL + JSONB work for you there?
- astine 8y agoI assume it could, but haven't tried it.
- 6t6t6t6 8y agoAllegedly, Mongo is more efficient if you need to ingest billions of records.
- pritambaral 8y agoI remember when that was true, because MongoDB used to mmap files and skip fsync. /dev/null is more efficient than just about anything at ingesting billions of records, but not very useful, is it?
- riku_iki 8y agomongo is shared nothing architecture, which can linearly scale data-wise, postgres is not and can't.
- user5994461 8y agobullshit. It's shared everything. if you have a 3 nodes cluster for redundancy, the 3 nodes keep the exact same data with only one node accepting reads and writes. It's literally the opposite of linear scalability.
- riku_iki 8y agoin sharded setup each shard contains subset of data, each node doesn't contain all data: https://docs.mongodb.com/manual/core/sharded-cluster-shards/ https://docs.mongodb.com/manual/core/sharded-cluster-shards/ You are talking about replica sets, which is different concept.
- user5994461 8y agoIn a sharded setup, every shard must be on a 3 nodes cluster for redundancy (a replica set), the 3 nodes keep the exact same data with only one node accepting reads and writes. You have to add capacity (shards) 3 nodes at a time, two third of which sit unused. It's not scalable at all.
- riku_iki 8y agoIts scalable in terms that if your total data doesn't fit into single machine, you can distribute it between shards in mongo, but can't in pgsql. replica set is for redundancy and availability, but you can use replicas for reads, so scale your reads traffic. pgsql works absolutely the same way, you have one master which accepts writes and read-only slaves/replicas.