
Synchronous Memory-to-Memory Replication
When MemDB operates in this mode all replicas are consistent for every transaction.
As part of the transaction commit process all replicas (including the originating node) apply the commit. When a transaction
rolls back, none of the replicas apply the commit. The advantage of this approach is that there is never a window of time where
different replicas are out of sync. This mode allows Rhino to run an N-way active clustering architecture.
When MemDB operates in this mode re-synchronization is started when a new node enters the cluster. The new node will
receive a copy of the MemDB state, and once the copy process has completed it will participate in subsequent transactions.
The state of a MemDB running in this mode will survive the failure of N nodes provided that the cluster remains in the primary
component. The MemDB state is only lost if the cluster transitions from the primary component to the non-primary component,
or if the entire cluster fails (for example the power supply to the cluster fails).
Asynchronous SQL Replication
When MemDB operates in this mode all replicas are consistent for every transaction, and a disk based SQL database is kept
in-sync with the state of MemDB by asynchronous replication.
As part of the transaction commit process all replicas (including the originating node) apply the commit, and an update of
the SQL database is scheduled. When a transaction rolls back, none of the replicas apply the commit. The advantage of this
approach is that there is never a window of time where different replicas are out of sync, and that if all memory copies are lost
(for example the entire cluster loses power) a disk-based copy of the state is available. This mode allows Rhino to run an N-way
active clustering architecture.
There are two re-synchronization approaches used with this mode. The first applies when other cluster members are members
of the primary components. The first approach is as follows: re-synchronization is started when a new node enters the Rhino
cluster. The new node will receive a copy of the MemDB state, and once the copy process has completed it will participate in
subsequent transactions.
When there are no cluster members that have an up-to-date copy of the MemDB state (for example the cluster is restarted after
a complete power failure) and a node boots it will read the state stored in the SQL database and synchronise the MemDB state
with the SQL database state.
The state of a MemDB running in this mode will survive the failure of N nodes regardless of whether or not the cluster remains
in the primary component. The MemDB state is lost if the on-disk copy is lost (for example the disks fail) and either the cluster
transitions non-primary or all cluster nodes fail (for example due to cluster power failure).
No Replication
MemDB supports a mode of operation that does not perform any replication. This mode has the highest performance of the
MemDB modes as it does not need to perform replication. In this mode each Rhino node has a separate view of the state in the
MemDB. The failure of a node means that the state stored in that MemDB is lost.
This mode is appropriate for applications or application components that do not require replication. Applications that fall into
this category typically do not require a particular activity to be continued on other nodes after a failure.
18.2.2 Concurrency Control
All MemDB replication models support both the optimistic and pessimistic concurrency control.
When using pessimistic access and a replicated MemDB, MemDB will acquire a distributed lock the first time an addressable
element of state is accessed in a transaction. Addressable units of state include an SBB entity, an Activity Context attribute, or
a Profile Table Entry.
In a MemDB using a replicated mode, optimistic concurrency control exhibits slightly lower latency than pessimistic concur-
rency control due to the fact it does not have to acquire distributed locks.
MemDB includes deadlock detection so that deadlocked transactions are detected and rolled-back.
A single MemDB supports both optimistic and pessimistic components in a single transaction. In such a case if optimistic
concurrency control conflicts are detected in the prepare phase the transaction is rolled-back. Transactions will also roll-back if
Open Cloud Rhino 1.4.3 Administration Manual v1.1 105
Comentarios a estos manuales