Durability

class borneo.Durability(master_sync, replica_sync, replica_ack)[source]

Bases: object

Durability defines the durability characteristics associated with a standalone write (put or update) operation.

This is currently only supported in On-Prem installations. It is ignored in the cloud service.

The overall durability is a function of the SYNC_POLICY and ACK_POLICY in effect for the Master, and the SYNC_POLICY in effect for each Replica.

SYNC_POLICY represents policies to be used when committing a transaction. High levels of synchronization offer a greater guarantee that the transaction is persistent to disk, but trade that off for lower performance. The possible SYNC_POLICY values are:

  • SYNC writes and synchronously flushes the log on transaction commit. Transactions exhibit all the ACID (atomicity, consistency, isolation, and durability) properties.
  • NO_SYNC does not write or synchronously flush the log on transaction commit. Transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but if the application or system fails, it is possible some number of the most recently committed transactions may be undone during recovery. The number of transactions at risk is governed by how many log updates can fit into the log buffer, how often the operating system flushes dirty buffers to disk, and how often log checkpoints occur.
  • WRITE_NO_SYNC writes but does not synchronously flush the log on transaction commit. Transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but if the operating system fails, it is possible some number of the most recently committed transactions may be undone during recovery. The number of transactions at risk is governed by how often the operating system flushes dirty buffers to disk, and how often log checkpoints occur.

REPLICA_ACK_POLICY defines the policy for how replicated commits are handled. A replicated environment makes it possible to increase an application’s transaction commit guarantees by committing changes to its replicas on the network.

Possible REPLICA_ACK_POLICY values include:

  • ALL defines that all replicas must acknowledge that they have committed the transaction. This policy should be selected only if your replication group has a small number of replicas, and those replicas are on extremely reliable networks and servers.
  • NONE defines that no transaction commit acknowledgments are required and the master will never wait for replica acknowledgments. In this case, transaction durability is determined entirely by the type of commit that is being performed on the master.
  • SIMPLE_MAJORITY defines that a simple majority of replicas must acknowledge that they have committed the transaction. This acknowledgment policy, in conjunction with an election policy which requires at least a simple majority, ensures that the changes made by the transaction remains durable if a new election is held.

The default Durability is configured in the proxy server with which this SDK communicates. It is an optional startup parameter.

Methods Documentation

__init__(master_sync, replica_sync, replica_ack)[source]

Create a Durability object

Parameters:
  • master_sync (SYNC_POLICY) – the master sync policy
  • replica_sync (SYNC_POLICY) – the replica sync policy
  • replica_ack (REPLICA_ACK_POLICY) – the replica ack policy

Attributes Documentation

REPLICA_ACK_POLICY

REPLICA_ACK_POLICY

alias of Enum

SYNC_POLICY

SYNC_POLICY

alias of Enum