level-replicate
master-master replication with levelup.
Implements scuttlebutt style handshake and then syncs data, then replicates real time changes.
Example
Replicate from a between two processes. One process starts a server, and another connects.
//master1.jsvar level =var SubLevel =var net =var Replicate =//setup the database.var db =//install Master plugin!var master =//create a server, and stream data to who ever connects.net
Then, the code for the client!
//master2.jsvar levelup =var SubLevel =var net =var Replicate =var db =var master =var stream = netstream
Wow, that was simple.
Binary data.
by default, level-replicate supports buffers by converting them to base64 via stream-serializer
and json-buffer
.
If you desire more efficiency, use level-replicate/msgpack
var Replicate =var db =var master =
Replicating Sublevels Recursively
//install Master plugin with the `recursive` option set to `true`.var master = // changes made to all sublevels of `db` will replicate!db
note: this depends on having level-sublevel@>=5.2.0 with level-hooks@>=4.5.0
License
MIT