hleclerc / AgencyDB

P2P database based on operational transform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AgencyDB is a peer to peer reactive database, where one stores operations (compressed) rather than states.

Merges (for operations made in parallel) are handled using operational transform. One of the main goal of AgencyDB is to provide a framework to describe types (content, handling of scheme evolution), operations and relations between them in a clear and language neutral way.

For every kinds of client type, AgencyDB tries to be as idiomatic and transparent as possible. Queries are constructed using lazy evaluation with types supporting the usual methods one can find in the target languages. It enables notably to handle asynchrony, out-of-core data and complex queries using usual (synchronous) language construct.

For instance

// create a new db instance (asynchronous)
let db = new Db( "my_tracker.io" );
db.connect( "bob", "pass" );

// bind local or remote variables to javascript variables (asynchronous)
let ar = db.bind( "~/my_array", Array );
let re = db.bind( "~/my_sum", Number );

// query is executed taking "data gravity" into account
// the lambda function is executed symbolically so that 
// the query can be sent and executed elsewhere.
// Of course, the call is asynchronous (re will be a
// pointer to a graph node).
ar.forEach( x => re += x ) );

APIs may change a lot in the future (near or not, depending on time available to work on the project). AgencyDB can be seen as an experimental tool to think about implementations of operational transform and some possible features of future databases.

About

P2P database based on operational transform


Languages

Language:C++ 55.2%Language:TypeScript 29.6%Language:C 7.7%Language:CoffeeScript 6.2%Language:Python 1.1%Language:Makefile 0.1%Language:Objective-C 0.1%Language:Shell 0.0%Language:HTML 0.0%