Replicating documents based on document's properties

692 views
Skip to first unread message

Vaevictus

unread,
Feb 26, 2011, 7:29:58 AM2/26/11
to mongod...@googlegroups.com
Incorrectly posted this over on mongodb-csharp:

Consider a web application that has several instances on 2 interconnected lans: (excuse the ascii)

LAN1                                  LAN1                                          LAN2
===========                   ===========                     ==========
WebServer1    |   --------------> Webserver2    ------------------>Webserver3
MongoServer1 |   <-------------  MongoServer2 <---------------- Mongoserver3
===========                   ============                  ===========

Everything document created on webserver1 needs to go to webserver2 and vice versa

Documents that have a certain flag set (eg to releasableToLAN2) are allowed to be replicated to webserver3

Does mongodb support this selective replication of data based on the metadata of the document?

Also, how well does the replication perform over slow/unstable links. Assume that the interconnection between lan1 and lan2 is 1mbit and very high latency (600ms+)

Thanks,
Craig

PS. the actual architecture has more complexities - if the above is possible I will make a more detailed post with a jpg

Scott Hernandez

unread,
Feb 26, 2011, 10:20:05 AM2/26/11
to mongod...@googlegroups.com
Mongodb does not support partial replication. To do something like
this you would have to write your own replication algorithms.

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>

Vaevictus

unread,
Feb 26, 2011, 10:27:33 AM2/26/11
to mongod...@googlegroups.com
Hi Scott,

Thanks for your response. That's a shame. Do you think it is something that will ever be supported in the future?

Craig

rainier2

unread,
Feb 26, 2011, 11:16:58 AM2/26/11
to mongodb-user
Hey,

Check out Wordnik's Java-based replication tools: https://github.com/wordnik/wordnik-oss
(specifically com.wordnik.system.mongodb.ReplicationUtil). I think
they may be just what you are looking for. Also check some of their
blogposts (http://blog.wordnik.com/12-months-with-mongodb). I tried
to find the video from MongoSV addressing this issue specifically, but
didn't see it.

One great thing about Mongodb replication is that it is easily
hackable, since the oplog is a regular collection (rather than MySQL,
which has a different binary log format). It might not be a feature
written by 10gen, but it should fit comfortably with the mongo stack.
No shame in that.

-nick

Scott Hernandez

unread,
Feb 26, 2011, 11:46:12 AM2/26/11
to mongod...@googlegroups.com
It isn't on the immediate road map but people have rolled their own
and there may be community supported options which aren't part of the
server.

Good luck.

Reply all
Reply to author
Forward
0 new messages