revs

2.0.1 • Public • Published

Revs: Simple sync framework

Revs is a system that simplifies and optimizes the communication between any two systems. By performing actions between DBs, revs will attempt to send the change to other systems so that eventually it will apply the same action on the other system.

Getting started

Simply install

npm install --save revs

How it works

 
var Revs = require('revs');
 
// System 1
var db1 = new Revs(function (action) {
  // apply action on system 1
}, {
  send: function(actions, cb) {
    // send to system 2
    cb(null, true)
  }
});
db1.perform({ message: 'some action' });
 
// System 2
var db2 = new Revs(function (action) {
  // apply action on system 2
});
server.on('received-from-machine-1', function (action) {
  // received from system 1
  db2.receive(action);
})

Using this incredibly simple framework, revs lets you focus on the implementations of actions on the system, and so you don't have to worry about how the action actually gets between system 1 and system 2. revs already comes with popular methods for communicating between systems: HTTP, websocket, between processes, etc and also using any encoding that would be efficient; protobufs, binary blobs, JSON, etc.

Communication

Setting up communication with middleware is pretty easy, but depends largely on the medium you have to travel between. Obviously, travelling within the same computer will be orders of magnitude faster than travelling over a LAN, which will of course be slower than travelling over the Internet. Depending on your needs, we have a variety of supplementary repositories that makes transfer easy.

Please refer to the respective repos on how to set up communication between revs dbs.

Contributions

Are welcome!

This library was initially made by the awesome team of engineers at Diamond.

If you haven't already, make sure you install Diamond!

Package Sidebar

Install

npm i revs

Weekly Downloads

7

Version

2.0.1

License

MIT

Last publish

Collaborators

  • diam
  • leander