FaunaDB
Lets study the architecture of FaunaDB and the guarantees provided by it.
FaunaDB is a distributed datastore inspired by the
Calvin protocol
Calvin is based on the following central idea:
By replicating inputs instead of effects to the various nodes of the system, it’s possible to have a more deterministic system where all the non-failing nodes go through the same states.
This determinism of the Calvin protocol can obviate the need for agreement protocols, such as two-phase commit, when performing distributed transactions since the nodes involved in the transaction can rely on each other, proceeding in the same way.
Abstract architecture of FaunaDB’s architecture
The abstract architecture of FaunaDB is composed of three layers.
The sequencing layer
The sequencing layer receives inputs or commands and places them in a global order, which is achieved via a consensus protocol.
This is the sequence all the nodes will execute the operations.
The scheduling layer
The scheduling layer orchestrates the execution of transactions using a deterministic locking scheme to guarantee equivalence to the serial order specified by the sequencing layer . It also allows transactions to be executed concurrently.
The storage layer
The storage layer is responsible for the physical data layout.
Roles performed by FaunaDB’s nodes
Every node in FaunaDB performs three roles simultaneously:
Query coordinator
Query coordinator receives and processes a request.
Note: The request might be processed locally or routed to other nodes, depending on its type.
Data replica
The data replica stores data and serves them during read operations.
Log replica
The Log replica reaches consensus on the order of inputs and adds them to the globally ordered ...