54 points · by Fudgel · 4y ago · 60 comments
> The performance of $lookup has also been upgraded. For instance, if there is an index on the foreign key and a small number of documents have been matched, $lookup can get results between 5 and 10 times faster than before. If a larger number of documents are matched, $lookup will be twice as fast as previous iterations. If there are no indexes available (and the join is for exploratory or ad hoc queries), then $lookup will yield a hundredfold performance improvement.
It should have been done long time ago. Better late than never.
MongoDB is anything but dead.
Also MongoDB isn't even 15 years old, so how could it have died 15 years ago?
Disclaimer: ex-MongoDB employee.
MongoDB blends the commercial aggressiveness of Oracle with the audit mindset of IBM. The sleaziest in the game.
It’s also strange because they keep demanding license fees and asking to audit and I just deny and tell them to buzz off.
They remind me of Oracle. It also makes me wonder if there’s some legal compulsion that could force them to do discovery. Based on their behavior I would not use mongodb.
Oracle eventually faded in relevance similar to IBM. So will Mongo. It will be around as a relic living by auditing the installed base.
Companies that adopted this technical debt during its prime (2010-2015) and are now paying for enterprise licenses and support to service that debt.
Personally I disliked it, primarily due to personal bias towards RDBMS (most data is inherently relational and I saw a lot of unnecessary hoops getting jumped through to join data) and also because the driver situation was absolutely terrible when I had to work with it. Custom drivers to serialize almost any JSON data was incredibly annoying.
From a developer standpoint it's alright, we're getting to the scale now where we're thinking about migrating to a more global architecture and I'm glad we're using something like Mongo over trying to hack this out with Postgres.
The standard issues with trying to use MongoDB like a regular ol' SQL DB still apply though, and our developers (me included) still fall into using anti-patterns and have to speak with solutions engineers once in a while.
Can you share the use cases? Why Mongo works better than Postgres?
Circa 2013 or so I was working for a regional newspaper group. They decided they wanted a weather section. So we subscribed to, iirc, Accuweather.
I wrote a script that would pull it down at the update interval (Every 15 minutes I think it was)
This was, for the time, for a shoestring outfit with only a few servers, a lot of data.
Something like 50k locations, with around 30 “rows” for each location - current conditions plus hour by hour going out a bit more than a day.
Loading this into our poor little MySQL server was… slow.
So I just setup a small mongo instance, and loaded/read from that. Worked great… we didn’t care about durability so we dodged that whole minefield. Mongo had a way to atomically swap two tables… so the import script would load into a scratch table, then swap that into the one the web server actually read from.
Loaded super fast since we didn’t care about durability, and read performance was more than adequate for the very simple queries we ram against it.
(To give you a feel for the era, this is when MyIASM was the default table store, and didn’t support fks or transactions)
With Mongo, its distributed by default. And if your data keeps growing, you simply add more nodes without any additional changes in the application code.
JSON indexing is quite advanced in mongo. Postgres is catching up (gin indexes on jsonb arrays). So are aggregations on json
MongoDB Atlas - fully managed and by MongoDB core committers
We don't have a lot of multi document ACID requirements.
We are on GCP and cloud sql is a very basic postgres deployment and we don't want to mange infra
The most obvious one being where you are requesting data and related data based upon a unique business identifier.
NoSql DBs mostly make this both trivial and fast.
Postgres and other SQL options become relevant where aggregation and reporting become primary considerations.
Hosting and infrastructure?
Sure for your weekend project there are plenty of alternatives. At enterprise level you aren't paying for just the base product you're paying to have someone else worry about all the other stuff that keeps it up and running.
Yes you can find Couchdb hosting services but it's very nice to have the company that builds the product also control the hosting.
I've worked at a company that was fairly large MongoDB customers. Even though MongoDB was a major part of our overall product there was never a second of considering hosting our own solution, and there was likewise never a time I remember Mongo being responsible for a major outage or other infrastructure issue. That's worth quite a lot of money to not have to worry about an essential part of your own internal product infra.
(Honest answer: a company can continue way longer than you think just supporting legacy customers - need Lotus Notes? https://www.hcltechsw.com/notes )
Also, I look at projects which have survived over a decade rather fondly. ;)
Here is a few I know are public references:
MetLife, Epic Games, Bosch, Inland Revenue (UK), Department of Work and pensions (UK) Barclays, HSBC, Boots, Forbes, Toyota, Sanoma, Intuit, Verizon.
MongoDB Community Edition is a powerful software.
but in all seriousness. hstore is good enough for 99% of mongodb users
Would it be feasible to use both, from within the same application, depending on the type of data in question?
The SQL vs. No-SQL debate has been going on for along time. Why not use both? Has anybody tried that?
Reducing the cognitive load is important in large code bases.