Replicated Key Value storage using Android
This was my fourth project in Android. This project involves designing a simple distributed replicated-value storage based on Dynamo.
It is a simplified version of Dynamo, which includes partitioning, replicating and handling failures. The Simple Dynamo is built on top of the android
content provider.
System Architecture
Design Overview
The design is
pretty simple as seen from the above diagram. The Dynamo (Content Provider) has a server thread and client threads which
communicate by sending messages.
Quorum manager at the client side will check whether reader quorum size and writer quorum size is satisfied in the respective cases. There are different types of message for Put, insert, query, recovery
etc, which simplifies the application logic.
Handling Failures
Case: Coordinator fails
If the coordinator node fails, then its first
successor is contacted to see if the operation can be continued with the first successor
acting as a make shift coordinator; if at this point, even the first successor has failed, then we proceed to contact the second successor which
will now take
on the role of make shift coordinator. If this whole process fails,
we retry after a reasonable delay.
Case: Successor fails
Since only
one node failure is assumed in the system at any given point in time, the quorum for read/write will be satisfied by getting two votes, one from the coordinator and the other
from a successor, and the operation will continue seamlessly.
Node Recovery
Case: Get values from first
predecessor
and first successor |
second successor
Case: Get values from second predecessor
| second predecessor and first successor
In either of the above case the system can recover all its values successfully. These are the ideal cases given our system constraints.
Comments
Post a Comment