seamlessly synchronise trip information between devices as well as share and receive navigation information with other people (e.g., friends or companies). • NavCloud aims to be scalable and reactive while ensuring privacy and security
conflicts more important • Devices go offline time to time and upon establishing connection, they will send all the data created while they were offline to the server • These data may be stale
be highly available • Riak has been designed as multi-node, master- less system • Any node is capable to receive commands and queries • So what is the most current version of a value?
as it uses for inter-node synchronisation for new writes issued by the user • User needs to send the last seen vector clock upon any write (X-Riak-Vclock header).
the vector clock associated with value • Upon any write, application returns back the last seen vector clock to Riak • If the vector clock is stale, sibling will be created • Upon the next fetch, application decides which sibling is the most current one. • Application writes back the most current one to the Riak to retrieve the most current vector clock to be used in the next write
immutable in your entire life. (append only) • Solution #2: It is not always necessary to write back the result of the conflict resolution in Riak • Solution #3: Use conflict free data structures (cannot be covered in this presentation)
bucket to keep user sessions in NavCloud • So first, the user needs to be authenticated and the session is created in this bucket • From now on, for every authenticated request we need to keep some meta information to prevent replay attack • This meta information should be removed after some period to prevent Riak to be exploded
request, we update the session entry and append that meta information to its JSON (updating phase). • Before writing back the session to Riak, we removed all expired meta information (pruning phase).
For every authenticated request, a Riak write happens. So, IO operations surprisingly increased (Considering we use eLevelDB as the backend and all of compactions etc.)
Updating session value may cause conflicts if user have multiple requests at the almost same time. • Conflict Resolution algorithm: Upon read, merge meta informations • But what about one of the clients poll server every 500ms? Sibling explosion + endless conflict resolutions
always • NavCloud case • User may send two destination at almost the same time to NavCloud. • Considering the tunnel case, we need to really find out which route is actually the latest.
always • Initial solution • Together with destination, we send timing information to the server. • So, if sibling is created, upon read, we pick the one with the latest timestamp. • Then, we write it back to Riak and return the resulting vector clock together with the value as response.
always • Each value in Riak has a vector clock associated with. • So do Siblings • After resolving the conflict, instead of writing back to Riak to retrieve the latest vector clock, application may just return the sibling vector clock which is at this moment the latest. • It will be eventually resolved in Riak