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.

enter image description here

following methods consider using.

  1. mongodb replication - replicates collections. selective replication possible in mongodb ??
  2. 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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -