InterDB
InterDB is a shared database with auto discovery.
Example
const interdb = const con = // Globalcon // Start local db onlyconstart namespace: 'business' password: 'long-password' path: './path.db' localPath: './path.local.db' // optional identity : // Info that will be shared to other dashboards // join networkcon // exit network // Busconclients*// Refer to Synapsis documentation (https://github.com/Unitech/synapsis) // local DBconlocalDb // put new data in existing key or create itconlocalDb // push data in existing key if it's an array or create an array with value in first indexconlocalDb // delete keyconlocalDb // get value from keyconlocalDb // Overwrite databaseconlocalDb // Get timestamp of latest actionconlocalDb // save changes (use if you modify con.localDb without API) // Shared DB (all of local API but broadcast changes over network)condb // put new data in existing key or create itcondb // push data in existing key if it's an array or create an array with value in first indexcondb // delete keycondb // get value from keycondb // Overwrite databasecondb // Get timestamp of latest actioncondb // save changes (use if you modify con.db without API)
Database structure
{ lastUpdate: "", data: {}}
Communication structure
Normal
Host A <-> Host B <-> Host C ^----------------------^
Problem
Host A <-> Host B <-> Host C