java - Selective replication in mongodb -
i have 2 mongodb running in 2 different servers connected via lan. want replicate records few collections server 1 collections in server 2. there way it. below pictorial representation of want achieve.
following methods consider using.
- mongodb replication - replicates collections. selective replication possible in mongodb ??
- oplog watcher apis - please suggest reliable java apis
is there other way ? , best way of doing ?
mongodb not yet support selective replication , sounds though not looking selective replication more selective copying since replication ensures rules of using server.
i not sure mean oplog watcher api easy enough read oplog on time querying it:
> use local > db.oplog.rs.find()
( http://docs.mongodb.org/manual/reference/local-database/ )
and storing latest timestamp of record have copied within script make.
you can use tailable cursor here on oplog effectiely listen (pub/sub) changes , copy them on other server.
Comments
Post a Comment