tag:blogger.com,1999:blog-18508356.post68586912623566395..comments2026-02-13T11:24:21.556-05:00Comments on Just a little Python: Multi-Master Replication in MongoDBRick Copelandhttp://www.blogger.com/profile/11612114223288841087noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-18508356.post-59423708333576670112014-03-11T03:32:15.963-04:002014-03-11T03:32:15.963-04:00What about the case where you might want many repl...What about the case where you might want many replica sets to sync with many? <br /><br />For example: Replica set A sync's to set B, B syncs to set C, and B also syncs to D. Services running on each replica set would determine if it's replication partner is up or not and establish a new replication partner (on a higher cost route). So if B were to drop out, D might connect to A and C to D. With this sort of configuration site based clusters could operate and continue to operate without some of the limitations of mongo replication sets. Anonymoushttps://www.blogger.com/profile/14534834486748410616noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-75469000551295715102013-11-26T12:47:44.518-05:002013-11-26T12:47:44.518-05:00No, I haven't run any experiments with replica...No, I haven't run any experiments with replicas falling behind. There is another project that seems to have more momentum here: http://blog.mongodb.org/post/29127828146/introducing-mongo-connectorRick Copelandhttps://www.blogger.com/profile/01076166064171435559noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-76467076240579359332013-10-08T21:08:46.990-04:002013-10-08T21:08:46.990-04:00Looks very promising ! I am going to try it and le...Looks very promising ! I am going to try it and let you know...<br /><br /><br />Regarding "Replication can fall behind if you're writing a lot. This is not handled at all" .. <br /><br />Did you run some experiments for the same. ? Does this also work for primary mongo db servers located in different locations?<br />Amit Santhttps://www.blogger.com/profile/13184000241759731788noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-77620289827575240392013-05-01T09:43:59.667-04:002013-05-01T09:43:59.667-04:00Thanks for the comment. Glad you enjoyed it!Thanks for the comment. Glad you enjoyed it!Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-2146405266111392202013-05-01T05:31:52.894-04:002013-05-01T05:31:52.894-04:00Nice work, thanks!Nice work, thanks!Anonymoushttps://www.blogger.com/profile/00732442992035257131noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-187116049760809202012-11-02T22:19:49.025-04:002012-11-02T22:19:49.025-04:00Yeah, imagine throttling writes so that we may not...Yeah, imagine throttling writes so that we may not be able to keep in sync with the oplog (it will eventually start overwriting while we are still processing some elements). I think this is what secondaries have to deal with. Do you have any suggestions on how to tackle this ? I thought about mimicking mongodb's approach. I just started studying the source code, so I'm not sure how difficult it is, perhaps their solution involves some kind of locking which I wouldn't be able to do in the app layer.<br /><br />Thanks for your reply.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-36765977192935375372012-11-02T17:25:14.651-04:002012-11-02T17:25:14.651-04:00Thanks for the comment.
I'm not sure what yo...Thanks for the comment. <br /><br />I'm not sure what you mean by "'falling behind' is not an option"; did you envision some mechanism for throttling writes to the system? In that case, you'd probably need to build a higher-level abstraction. MMM doesn't have any facility for doing that at present.Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-39457408061516614142012-11-02T17:12:01.042-04:002012-11-02T17:12:01.042-04:00Really nice and informative post, thanks for this....Really nice and informative post, thanks for this.<br />I have a question though, what approach would you take for tailing the oplog if 'falling behind' is not an option ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-44467332395359699722012-09-07T11:27:36.998-04:002012-09-07T11:27:36.998-04:00Thanks for the comment! While it's true that I...Thanks for the comment! While it's true that I didn't modify the mongod binary in any way, I would say that if you set up bidirectional replication in MMM for a collection, you do have a system that behaves as a multi-master system. Once you have MMM running, the replica sets aren't really "independent" anymore. But we might be splitting hairs over semantics. Anyway, thanks for taking the time to read and respond to the article!Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-23445594205731772132012-09-07T11:22:45.031-04:002012-09-07T11:22:45.031-04:00Strictly speaking, this isn't adding multi-mas...Strictly speaking, this isn't adding multi-master to Mongo. What it *is* doing is replicating between independent replica sets, each of which still has its own single master. Not that I'm complaining - it's a very useful and practical demonstration of how to extend MongoDB.Anonymoushttps://www.blogger.com/profile/01855998205950703652noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-26105258647703453832012-07-14T09:42:12.304-04:002012-07-14T09:42:12.304-04:00MongoDB provides a few advantages over CouchDB, in...MongoDB provides a few advantages over CouchDB, including a more flexible query syntax and better performance. A full comparison between the two is a bit beyond the scope of a comment, though. For this particular use case, my client is already committed to using MongoDB (there's a little too much code written to pivot quickly at this point), including MongoDB-specific bits like gridfs. <br /><br />Incidentally, my client is actually the same person that made the decision to go with MongoDB and not CouchDB at SourceForge, though he's not with SourceForge any more.Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-19275245681159263382012-07-11T14:56:32.623-04:002012-07-11T14:56:32.623-04:00Must ask: Why not go just with CouchDB?Must ask: Why not go just with CouchDB?Esa-Matti Suuronenhttps://www.blogger.com/profile/12202070899547827835noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-24342113745352915172012-07-09T16:42:28.777-04:002012-07-09T16:42:28.777-04:00I have been advised by someone who should know tha...I have been advised by someone who should know that secondaries can indeed replicate from other secondaries in MongoDB replica sets for more complex topologies, but there is still only a single primary capable of accepting writes.Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-79615811709134268932012-07-09T14:14:45.683-04:002012-07-09T14:14:45.683-04:00Very cool :) It's really nice how mongo provi...Very cool :) It's really nice how mongo provides all the tools you need (oplog, tailable cursors, etc) to be able to implement something like this.Anonymousnoreply@blogger.com