CEDA supports synchronisation of replicated databases by sending operations in one-way messages. The distributed processing of operations is characterised as follows:
Advanced messaging systems such as RabbitMQ feature complex brokers which guarantee at least once delivery by persisting the messages. This approach embodies anti-patterns that create complexity and reduce robustness and performance.
As a matter of terminology we make a distinction between:
Messages contain serialised items. There isn't a one-to-one correspondence between items and messages. In a distributed system with many participating databases an item may be sent in many different messages. Also, it might make sense for messages to record multiple items, to amortise the space and processing overheads of messages, such as the message headers.
This means we make the following distinctions:
An ideal messaging building block for a distributed system is trivially built on top of TCP, and involves transient, reliable, ordered, exactly once point to point messages. This handles the sending and receiving of messages using transient send/receive buffers, and tends to achieve optimal performance, simplicity, testability and avoids the pitfalls.
Ordered delivery might be thought to be incompatible with parallelism, but it's certainly not. For example it's easy for a message handler to post its messages to a thread pool, or to forward messages onto other nodes in the network. It makes perfect sense to build a robust, scalable distributed system on top of transient point to point reliable ordered message streams.
Sequence numbers can typically be used to support crash recovery, roll back, late comers, failures etc without distributed transactions.
A persistent queue might seem analogous to a persistent messaging system, but it's different in some crucial respects:
Contrast this to a talk by Udi Dahan where he proposes a (poor) solution which he says has "lots of moving parts" to reliable messaging without distributed transactions.
These differences for example make it possible to implement strongly consistent bank account transfers using double entry bookkeeping [] without distributed transactions.
Using the same approach to managing goods allows for avoiding distributed transactions when managing the buying and selling of goods, and commericial activities more generally, such as involving
A sequence of contingent business activities is sometimes referred to as a long running transaction or saga.
Perhaps it's possible to avoid solving the consensus problem and yet avoid the issues around double spending. [see work in progress].