Native (Erlang)
This page describes the native Erlang API of Antidote.
Clients can invoke these functions via RPC. A more convenient but restricted way for client applications to interact with Antidote is the protocol buffer interface:
Protocol Buffer APICRDTs
Antidote provides a library of CRDTs. The interface of these CRDTs specify the operations and the parameters that can be used for inspection and modification of shared objects. In the following, we specify the supported {operation(), op_param()} pair for each of the supported CRDTs. The first element in the tuple specifies the update operation, and the second item indicates the corresponding parameters.
antidote_crdt_counter_pn
{increment, integer()}
{decrement, integer()}antidote_crdt_set_aw
{add, term()}
{remove, term()}
{add_all, [term()]}
{remove_all, [term()]}antidote_crdt_gset
{add, {term(), actor()}}
{remove, {term(), actor()}}
{add_all, {[term()], actor()}}
{remove_all, {[term()], actor()}}antidote_crdt_register_lww
antidote_crdt_map_rr
antidote_crdt_register_mv
antidote_crdt_rga
Transactions
A unit of operation in Antidote is a transaction. A client should first start a transaction, then read and/or update several objects, and finally commit the transaction.
There are two types of transactions: interactive transactions and static transactions.
Interactive transactions
With an interactive transaction, a client can execute several updates and reads before committing the transactions. The interface of interactive transaction is:
Example
Static transactions
Static transactions consist of a single bulk operation. There are two different types:
A client can issue a single call to update multiple objects atomically.
A client can issue a single call to read to multiple objects from the same consistent snapshot.
It is not possible to read and update in the same transaction.
Example
Cluster management
An Antidote data center (DC) is a cluster of multiple antidote nodes. Antidote deployment can have multiple DCs where each DCs is a full replica. The cluster management API provides functions to create DCs and connect them.
Example
If 6 antidote nodes have already started, we can create two DCs with 3 nodes each as follows:
If there is only one node in a DC, you can skip above step. Do not add a node to 2 different DCs.
To connect two DCs:
Every DC must subscribe from every other DCs. If there are 3 DCs, execute subscribe_updates_from on each DC with the same Descriptors list.
Last updated