To design successful systems that spread across more than one node, you need to know and use certain principles. One of them is the CAP theorem. It's about one of the most important choices you need to make when designing a distributed system and owes its name to the three properties a distributed system can have. They are as follows:
- Consistency: Every read would get you the data after the most recent write (or an error).
- Availability: Every request will get a non-error response (without the guarantee that you'll get the most recent data).
- Partition tolerance: Even if a network failure occurs between two nodes, the system as a whole will continue working.
In essence, the theorem states that you can pick at most two of those three properties for a distributed system.
As long as the system operates properly, it looks like all three of the properties can be satisfied. However, as we know from looking at the fallacies, the network is unreliable...