Reliable Publish-Subscribe (Clone Pattern)
As a larger worked example, we’ll take the problem of making a reliable publish-subscribe architecture. We’ll develop this in stages. The goal is to allow a set of applications to share some common state. Here are our technical challenges:
We have a large set of client applications—say, thousands or tens of thousands.
They will join and leave the network arbitrarily.
These applications must share a single, eventually consistent state.
Any application can update the state at any point in time.
Let’s say that updates are reasonably low-volume, we don’t have real time goals, and the whole state can fit into memory. Some plausible use cases are:
A configuration that is shared by a group of cloud servers
Some game state shared by a group of players
Exchange rate data that is updated in real time and available to applications
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access