Run Multiple Servers

To deal with the large scale of Sneakers23’s online operation, we’ll need to run multiple servers at once. Running multiple servers can be difficult when in-memory data structures are used because updates are not automatically sent across the cluster. However, the scalability is certainly worth it. We have already discussed how Phoenix deals with this by broadcasting messages to all connected nodes, and we’ll use a similar solution to broadcast our Inventory changes across the cluster. Let’s start by demonstrating the particular problem we’re facing.

The Challenge of Distribution

Running multiple servers exposes a problem. The current Inventory.Server process only knows about its own transactions. This means that if an item ...

Get Real-Time Phoenix now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.