Live data from Hacker News

Ask HN: Do you still use MongoDB?

news.ycombinator.com

21–30 of 243 posts

Re: Ask HN: Do you still use MongoDB?

#21
Yes, it's our main DB. I still like it quite a lot, we use Mongoose as ODM, it makes adding new stuff so much easier without having to do things like alter table etc. But for our big data stuff we use BigQuery, simple because of cost.

I do like how easy it is to get a mongo instance up and running locally. I found maintenance tasks for mongo are much easier than postgres.

One thing you still need to do is manage indexes for performance, I've had to spend many a days tuning these.

I have come across some rather frustrating issues, for example a count documents call is executed as an aggregate call, but it doesn't do projection using your filters. e.g you want to count how many times the name 'hacker' appears. It will do the search against name, then do the $count, but because it doesn't do a projection, it will read the whole document in to do this. Which is not good when the property you're searching against has an index, so it shouldn't have to read in the document at all.

Re: Ask HN: Do you still use MongoDB?

#22
Yes, use it with Atlas for every one of my companies' projects.

- The document model is a no-brainer when working with JS on the front-end. I have JSON from the client, and Dictionaries on the backend (Flask), so it's as easy as dumping into the DB via the pymongo driver. No object relational mapping.

- Can scale up/down physical hardware as needed so we only pay for what we use

- Sharding is painfully easily, with one click

- Support has been incredible

Re: Ask HN: Do you still use MongoDB?

#23
post #14

Earlier quoted context omitted.

Have you compared with postgresql's jsonb?

jsonb is limited in it's querying capabilities. you're essentially casting the json as a string when storing and querying, it's not truly json. therein lies the advantage of document model, native secondary indexes, $ for everry nested layer, etc.

Postgres's jsonb format is definitely not "essentially" a string. You can get native indexes on json fields in Postgres, and you can query fields however you like.

Re: Ask HN: Do you still use MongoDB?

#24
No, I inherited a project that was using it a number of years back. After 6 months we migrated away to postgres. The data was really relational so it was just the wrong tool for the job. I can see that it might have value as a document store but with postgres' json facilities these days it's hard for me to see a scenario where I'd choose it.

Re: Ask HN: Do you still use MongoDB?

#25
post #14

Earlier quoted context omitted.

Have you compared with postgresql's jsonb?

jsonb is limited in it's querying capabilities. you're essentially casting the json as a string when storing and querying, it's not truly json. therein lies the advantage of document model, native secondary indexes, $ for everry nested layer, etc.

I don't believe that is true, as far as I understand jsonb is a binary representation, not text. And there are certainly ways to index jsonb columns, either a function index on a particular jsonb expression or a GIN index so that you can perform contains (@>) queries against the whole jsonb contents.

Re: Ask HN: Do you still use MongoDB?

#26
post #7

No - Postgres is faster and it has JSONB. (It also has tables and SQL and GIS and ...)

Can you provide benchmarks showing PostgreSQL is faster ?

Because from my experience MongoDB was at least 10x faster and all of the benchmarks I've seen were using pre-WiredTiger storage engine.

Re: Ask HN: Do you still use MongoDB?

#27
No. Every time I've used mongodb we've ended up regretting it for one reason or another. And migrating to a different database after launch is a huge hassle.

I've done a couple projects where we kicked off with postgres using JSONB columns for early iteration. Then we gradually migrated to normal SQL columns as the product matured and our design decisions crystallized. That gave us basically all the benefits of mongodb but with a very smooth journey toward classical database semantics as we locked down features and scaled.

Re: Ask HN: Do you still use MongoDB?

#28

Yes, it's our main DB. I still like it quite a lot, we use Mongoose as ODM, it makes adding new stuff so much easier without having to do things like alter table etc. But for our big data stuff we use BigQuery, simple because of cost. I do like how easy it is to get a mongo instance up and running locally. I found maintenance tasks for mongo are much easier than postgres. One thing you still need to do is manage inde…

why not just do a covered query with aggregate pipeline via $match and $project, hitting all your indexes, then pipe the results to $count.
Post reply on HN