7 ms·
MongoDB 4.0 will add support for multi-document transactions
- sloankev 8y agoCan you use this across collections?
- jaydestro 8y agoHi - I work at MongoDB - Yes you can. Documentation is located: https://docs.mongodb.com/master/core/transactions/#transactions-and-replica-sets https://docs.mongodb.com/master/core/transactions/#transacti...
- sbr464 8y agoFor mongo, with existing features or the new transaction feature, is it possible to access the ids that are generated during the update, to use on subsequent updates, as references, without needing to return to the dB client to process or build objects? Could be across collections also
- jchw 8y agoThis seems great, but I think until 4.2 they don't plan to have global point-in-time consistency - just per replica set. I wonder how this affects ACID semantics? Also: This is going to be really nice, but I sure hope a major cloud provider starts providing a managed service. It's very nice having a managed service like Amazon RDS or Google Cloud SQL.
- preinheimer 8y agoMongoDB has Atlas for managed services - https://www.mongodb.com/cloud/atlas https://www.mongodb.com/cloud/atlas MongoDB Atlas is a cloud-hosted MongoDB service engineered and run by the same team that builds the database. It incorporates operational best practices we’ve learned from optimizing thousands of deployments across startups and the Fortune 100. Build on MongoDB Atlas with confidence, knowing you no longer need to worry about database management, setup and configuration, software patching, monitoring, backups, or operating a reliable, distributed database cluster.
- rvanmil 8y agoOur team has been using both shared and dedicated plans at mLab https://www.mlab.com https://www.mlab.com for almost a year now and we’re very happy with the ease of use and we’ve had zero problems so far.
- jaydestro 8y agoThat's awesome but these features will not likely be on mlab at launch. You may be best using MongoDB Atlas, which will include all 4.0 features.
- TomK32 8y agoLet's be honest, lacking behind a few months, especially if it is a major release, isn't a bad idea. With Rails apps in production I keep upto a year of distance to the major releases because there's so many rubygems that need to catch up or be replaced.
- rvanmil 8y agoThat's probably true. I think it took mLab a couple of months to support 3.6. But then again, having a major version release available at launch doesn't seem that important to me compared to all other database-as-a-service features. Since you mentioned you work for MongoDB, if you guys could partner with Heroku and add Atlas to their official add-ons our team might be able to take a look and switch ;)
- jaydestro 8y agohttps://www.mongodb.com/blog/post/integrating-mongodb-atlas-with-heroku-private-spaces https://www.mongodb.com/blog/post/integrating-mongodb-atlas-... - private spaces works.
- cyberfart 8y agoMongoDB Ops Manager [1] (previously MMS) is also quite nice, it's between Atlas and do-it-yourself. [1] https://www.mongodb.com/products/ops-manager https://www.mongodb.com/products/ops-manager
- jaydestro 8y agoFYI a OpenShift/K8s integration is now in beta: https://blog.openshift.com/dev-preview-mongodb-enterprise-running-on-openshift/ https://blog.openshift.com/dev-preview-mongodb-enterprise-ru...
- TomK32 8y agohaha, mentioning RDS and SQL in a mongodb thread. I actually witnessed that once when a customer (and mongodb user) had some man power from an agency allocated and one of those guys mentioned RDS. I wasn't impressed.
- jchw 8y agoWell, I use SQL databases and MongoDB a lot, sometimes even in the same exact project. It turns out that while most data can be looked at as either relational or document-based with enough contortion, some of it leans fairly strongly in one direction.
- fowl2 8y agoMicrosoft have something they claim is wire compatible: https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-introduction https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-int...
- mlthoughts2018 8y agoMongoDB represents to me a very good way to build a product. There has always been so much derisive criticism about MongoDB opting to prioritize convenience of customer workflows above all else, and to go back and add best practices, basic data safety, etc., on a piecemeal basis after the fact. Customers are surprisingly willing to put up with problems as long as usability and user experience is high, and they will wait for other features. Meanwhile, plenty of other database projects may start out with a more deliberate focus on classical database safety and guarantees, yet hardly build any customer base. Even though I may like e.g. Postgres features more, there is still something to be respected about how MongoDB has operated, and the constant vitriol about their chosen priorities has always sounded hollow to me, even accounting for stories about data loss, etc. Incidentally, I once had the chance to tour the MongoDB office near Times Square, and boy, I can tell you it is not an office environment for me. Extremely loud, and they even have things like scooter parking slots and signs for “scooter etiquette” for rolling around the office on a scooter. I’m not sure how they are able to focus on any engineering work, but kudos to them for finding a way.
- jayd16 8y agoI won't agree that its a good way to build a product, but its a marketing miracle that Mongo us used in production as widely as it is.
- marenkay 8y agoNot trying to be sarcastic here but isn't this the case for most products in their early years and even for some that are "old"? Every offering has its' issues but most of the time there is one feature that makes dealing with these worth it.
- overcast 8y agoThat's the point. Using relational data in a non-relational system is just foolish, and introduces issues not worth dealing with. What exactly is MongoDB going to give you over PostgreSQL in that case?
- deleted 8y ago[deleted]
- koolba 8y agoFollowing through the blog to the actual docs: https://docs.mongodb.com/master/release-notes/4.0/ https://docs.mongodb.com/master/release-notes/4.0/ > By default, multi-document transactions wait 5 milliseconds to acquire locks required by the operations in the transaction. If the transaction cannot acquire its required locks with the 5 milliseconds, the transaction aborts. Automatic cancellation rather than actual deadlock detection is going to be one hell of a footgun. I'd argue this is a double barreled footgun as most usage of MongoDB is from garbage collected languages. One wrongly time GC and your transaction is dead.
- xeromal 8y agoWhat's a footgun? Is that a play on shooting yourself in the foot? :P
- breser 8y agoGenerally a footgun is something that's designed in such a way as to be extremely likely to be used in a way that's going to cause problems for yourself. Yes it's a play on shooting yourself in the foot, the idea is that you designed a gun designed to shoot yourself in the foot. https://www.urbandictionary.com/define.php?term=footgun https://www.urbandictionary.com/define.php?term=footgun
- hinkley 8y agoIt's talking about shooting yourself in the foot, but doesn't blame the victim. For me, it's one of the better cultural changes in software development in the last five years.
- bpicolo 8y ago> One wrongly time GC and your transaction is dead Are the locks not database-side, rather than client-side?
- cyberfart 8y agoYes, locks are server-side.
- arghwhat 8y ago> "... making it the only database to combine the speed, flexibility, and power of the document model with ACID guarantees." PostgreSQL with JSONB columns seems to have beat them to the race by quite a wide margin. MySQL too, for that matter.
- lilbobbytables 8y agoI do really enjoy using Postgres for a hybrid approach, using a jsonb field to store a bunch of data about an object. It works very well, and query speeds are great since you can index fields.
- thecopy 8y agoWe use PostgreSQL with normal cols and JSONB columns, as well, which works wonderful. High speed, high flexibility, and all the transactional quarantees Postgres gives you. Also, we can use SQL.
- ravenstine 8y agoThis comes at a perfect time for me, because I've been working on an application running on MongoDB and although I can get away without transactions, they would help significantly.
- ngrilly 8y agoNow we're waiting for Aphyr to test this works as intended :-)
- TomK32 8y agoGood bye MMAPv1. I like the changes about the date formatting and type conversions. In my current project I shortly had values store both as bigdecimal and float until I moved the calculations app-wards into Ruby.
- gremlinsinc 8y agoIs there really anything Mongo does, that actually makes it worth choosing over postgres or even mysql w/ jsonb? I mean, I think if I needed to think beyond sql, a graph db like arango or neo might make more sense...
- lilbobbytables 8y agoI'm really interested in this as well. It seems that postgres with jsonb is such an incredible generalist, that I don't see why if reach for mongo. This is also because I think of mongo as generalist, which may or may not be right. It seems as though there are better choices for more specific use cases
- gremlinsinc 8y agothe biggest use case (and it's a bad one), is because a stack (MERN/MEAN) and all tutorials for said 'stack' use mongo, or a framework like Meteor... it sort of locks devs into bad practices when being a little more picky, a little more curious about options could make for a better architecture. It's not like you couldn't rip out mongo in MERN and use PERN or MyERN (Mysql Express React Node). There's some good libs/packages for using relational db's, and the benefits may outweigh those of Mongo. I guess one other use case maybe would be an incremental/idle game, where all data is just stored as one big json doc, and you just need to connect/update totals, then sync that data back and forth, with not a lot of relationship/connections or transactional data.