News for hackers. Stuff that matters.
Re:MongoDB is actively investigating a security incident by goenning on Saturday December 16, 2023 @05:19PM (#38668282)
I never used/tried MongoDB, what are the reasons people choose MongoDB over other DBs?
Re:MongoDB is actively investigating a security incident by rglover on Saturday December 16, 2023 @07:29PM (#38669207)
- Highly-flexible. Because you're not developing against a schema, you can, for example, retool a feature and its data quickly without having to stress about migrations. A big advantage for a startup looking to move fast.

- Queries look more like application code so you're not wasting mental cycles and time trying to translate an idea into a SQL query. From experience, this leads to less-fragile queries.

- Little to no concern over injection attacks (you have to go out of your way to create potential for them).

- Easier to write non-trivial queries than with SQL (IMO).

- Type-casting data can be done in code as opposed to with SQL you have to use inline, platform-specific functions like field_name::timestamp.

- A single source of truth for how to query and develop with it (with SQL, you're almost always developing against a flavor of it).

- Scales reasonably well (and easily) for a majority of use cases.

- No room for dogmatic fervor/confusion around a specific variety of MongoDB as there's only one variety.

Re:MongoDB is actively investigating a security incident by djrobstep on Saturday December 16, 2023 @07:40PM (#38669264)
> Because you're not developing against a schema, you can, for example, retool a feature and its data quickly without having to stress about migrations. A big advantage for a startup looking to move fast.

Why wouldn’t you need to worry about migrations without developing against a schema? You’ll need to worry more about migrations because your data will be more messy.

Re:MongoDB is actively investigating a security incident by rglover on Saturday December 16, 2023 @08:26PM (#38669546)
> Why wouldn’t you need to worry about migrations without developing against a schema? You’ll need to worry more about migrations because your data will be more messy.

If you're careless with your data, yes. "With great power comes great responsibility."

Re:MongoDB is actively investigating a security incident by yawaramin on Saturday December 16, 2023 @10:04PM (#38669974)
Being careful with my data is exactly why I use a strongly typed RDBMS in the first place.
Re:MongoDB is actively investigating a security incident by winrid on Saturday December 16, 2023 @08:09PM (#38669448)
It could be rephrased as "worry about them later" :P gotta get those returns on the VC money and pawn those issues onto the next team in 7yrs :)
Re:MongoDB is actively investigating a security incident by rglover on Saturday December 16, 2023 @08:29PM (#38669556)
Not necessarily. If you're utterly careless, sure. A MongoDB migration is far less of a headache than a SQL one (you're just writing code to map/replace values). With SQL, you have to be frustratingly surgical about everything which can slow momentum to a crawl (read: punishment for mistakes in the migration is far worse than with MongoDB in my experience).
Re:MongoDB is actively investigating a security incident by winrid on Saturday December 16, 2023 @10:37PM (#38670124)
I completely agree! Kind of preaching to the choir :)
Re:MongoDB is actively investigating a security incident by risson on Sunday December 17, 2023 @12:58AM (#38670678)
So basically nothing Django and a postures db can't do.
Re:MongoDB is actively investigating a security incident by 010101010101 on Saturday December 16, 2023 @05:24PM (#38668321)
It was an early player when everyone thought NoSQL document databases solved every problem.
Re:MongoDB is actively investigating a security incident by jtriangle on Saturday December 16, 2023 @05:44PM (#38668493)
They did solve many problems, and then they caused many more problems...

At first at least, haven't checked in on that in awhile

Re:MongoDB is actively investigating a security incident by throwawaaarrgh on Saturday December 16, 2023 @06:54PM (#38668994)
And now everyone knows RDBMS solves every problem. Especially when it's SQLite.
Re:MongoDB is actively investigating a security incident by bossyTeacher on Saturday December 16, 2023 @05:31PM (#38668375)
Mongo is the main nosql choice. Mongo is great if you think a flexible schema is good. Mongo is not great if you think a flexible schema is bad. That sums it up
Re:MongoDB is actively investigating a security incident by iLoveOncall on Saturday December 16, 2023 @05:35PM (#38668403)
This is too reductive, you can essentially have flexible schemas with most modern relational databases and without the downsides of document-based DBs.

In 99% of the cases, even if you need a flexible schema, PostgreSQL will remain the best choice.

Re:MongoDB is actively investigating a security incident by pleoxy on Saturday December 16, 2023 @07:19PM (#38669150)
Unless it's not.
Re:MongoDB is actively investigating a security incident by booi on Sunday December 17, 2023 @02:43PM (#38675724)
it probably is though
Re:MongoDB is actively investigating a security incident by tgv on Saturday December 16, 2023 @05:29PM (#38668365)
I use it on-prem (well, on a VPS). It stores JSON documents, and it's easy to work with. If your data looks like a tree, it works pretty well, also for large documents. If you depend on relations between documents, you're better off with an SQL database, but note that for many cases --I'd say practically all mundane cases-- there's really no need for relations the SQL way. MongoDB also does relations, but a bit more convoluted.
Re:MongoDB is actively investigating a security incident by cpursley on Saturday December 16, 2023 @07:06PM (#38669064)
Postgres does all that plus 100x.
Re:MongoDB is actively investigating a security incident by winrid on Saturday December 16, 2023 @08:10PM (#38669454)
But the horizontal scaling is easier with Mongo than Citus.
Re:MongoDB is actively investigating a security incident by yawaramin on Saturday December 16, 2023 @10:06PM (#38669982)
But you don't need to horizontally scale if you use a beefy Postgres instance. Horizontal scaling is a problem created by using an inefficient DB in the first place.
Re:MongoDB is actively investigating a security incident by winrid on Saturday December 16, 2023 @10:36PM (#38670117)
I have DB clusters with masters with a terrabyte of ram. Going beyond that is a PITA with warming up cache, backups, and so on. There is a reason there's a huge industry for shared databases.

Also, query for query, Mongo isn't going to be that much slower than PG, and faster for some usage patterns...

Re:MongoDB is actively investigating a security incident by winrid on Sunday December 17, 2023 @03:05PM (#38675897)
*sharded
Re:MongoDB is actively investigating a security incident by tgv on Sunday December 17, 2023 @06:54AM (#38672260)
I've also tried SQLite, but they didn't do large documents that well. And the project was started before I was aware Postgresql had json support.

But what's the advantage of Postgresql in this case?

Re:MongoDB is actively investigating a security incident by salil999 on Saturday December 16, 2023 @05:22PM (#38668306)
It's pretty easy to start with. MQL is also pretty easy to understand + MongoDB kinda makes it fun.

Note: I work at MongoDB

Re:MongoDB is actively investigating a security incident by floydnoel on Saturday December 16, 2023 @06:03PM (#38668610)
And Atlas has a free tier! It's been powering my site (https://bongo.to) for years for a total price of $0. Incredible!
Re:MongoDB is actively investigating a security incident by webappguy on Saturday December 16, 2023 @05:24PM (#38668315)
What's the update internally here? How long this been going on for? Any juice?
Re:MongoDB is actively investigating a security incident by Jonovono on Saturday December 16, 2023 @05:29PM (#38668364)
It's a really great alternative to firebase for mobile apps. Works pretty nicely with Realm so you get offline first db with powerful syncing. All the benefits of realm on the edge device with the power of the mongo platform. I dismissed mongo atlas for years because "mongo", until I finally gave it a chance. Overall been pretty pleased.
Re:MongoDB is actively investigating a security incident by kagevf on Saturday December 16, 2023 @06:43PM (#38668913)
> It's a really great alternative to firebase for mobile apps.

Isn't firebase built on top of mongoDb?

Re:MongoDB is actively investigating a security incident by endisneigh on Saturday December 16, 2023 @08:58PM (#38669702)
No
Re:MongoDB is actively investigating a security incident by webappguy on Saturday December 16, 2023 @05:23PM (#38668311)
Easy, flexible scheme nosql, plenty of baked in features. Has it's place, and many times when it would not be a good choice too.
Re:MongoDB is actively investigating a security incident by insanitybit on Saturday December 16, 2023 @05:59PM (#38668587)
Enterprise support, lots of documentation, does what it says it does.
[dead]
Re:MongoDB is actively investigating a security incident by salil999 on Saturday December 16, 2023 @05:36PM (#38668413)
I see this Jepsen link posted all the time. People: PLEASE don't use outdated software. MongoDB has made mistakes and they are public about their data issues on https://www.mongodb.com/alerts. MongoDB 4.2.6 is old and I believe it's approaching EoL based on https://www.mongodb.com/support-policy/lifecycles

I'm not going to push for you to use MongoDB but am merely trying to provide some context around that Jepsen analysis.

Re:MongoDB is actively investigating a security incident by sgift on Saturday December 16, 2023 @06:07PM (#38668641)
That's why I've added the last part. Mongodb highlights old Jepsen analysis' on their page (https://www.mongodb.com/jepsen), but they never got around to ask them for another analysis to show things are so much better with MongoDB 5 or 6? Yeah. Sure. People are free to believe whatever they want, I'll continue to highlight the best info available.
Re:MongoDB is actively investigating a security incident by lolinder on Saturday December 16, 2023 @05:41PM (#38668465)
Based on that lifecycle doc, the 4.2 line is already EOL, and 4.4 will be soon.
Re:MongoDB is actively investigating a security incident by insanitybit on Saturday December 16, 2023 @05:51PM (#38668536)
> That they haven't paid for a thorough follow-up analysis after their supposed fix is all one needs to know

As much fun as Jepsen is, I'd probably not follow up with a company that turned my product into a mockery. I enjoy the hell out of reading that report as an outsider, and I personally would be a repeat customer, but I can see how a company might not love the writeup.

Re:MongoDB is actively investigating a security incident by sgift on Saturday December 16, 2023 @06:13PM (#38668695)
Sure, but to me that just looks like they have no faith in the supposed quality of their product. If they really fixed MongoDB there's nothing to fear. Aphyr is harsh, but fair.
Re:MongoDB is actively investigating a security incident by insanitybit on Saturday December 16, 2023 @06:19PM (#38668740)
Again, I can see why they would not be interested in engaging again. You can think that it's because they're afraid, but they also may have just really disliked the service they paid for.
Re:MongoDB is actively investigating a security incident by sigzero on Saturday December 16, 2023 @05:32PM (#38668382)
So nothing has changed in the 3 years since that article?
Re:MongoDB is actively investigating a security incident by chx on Saturday December 16, 2023 @05:50PM (#38668530)
I am not sure what's going on with Jepsen any more.

https://jepsen.io/analyses

there were zero done in 2021, two in early 2022 and even the footer copyright say 2022.

Re:MongoDB is actively investigating a security incident by sgift on Saturday December 16, 2023 @06:09PM (#38668656)
aphyr seems to still work on it, so probably just not that many companies who want to pay to get told the truth anymore: https://github.com/jepsen-io/jepsen
Re:MongoDB is actively investigating a security incident by DandyDev on Sunday December 17, 2023 @05:48AM (#38671956)
We use MongoDB in conjunction with RealmDB to build an offline first mobile app. For this specifically it works very well. You basically define which parts of your document collection should be synced to which device, for example based on a query that contains the user id. MongoDB takes care of syncing the right data to the right device when internet connection is available. On the device, the data is stored locally in RealmDB, which represents the other side of the sync.

This is not easy to do with PostgreSQL, which we use for all other scenarios requiring a DB.