Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fences make good neighbours

Fences make good neighbours

Dr Eric Brewer in 12 years of CAP Theorem
The subtle beauty of a consistent system is that the invariants tend to hold even
when the designer does not know what they are.
Consequently, a wide range of reasonable invariants will work just fine. Conversely,
when designers choose A, which requires restoring invariants after a partition, they
must be explicit about all the invariants, which is both challenging and prone to
error.
At the core, this is the same concurrent updates problem that makes multithreading
harder than sequential programming.

Shripad Agashe

October 14, 2017
Tweet

More Decks by Shripad Agashe

Other Decks in Programming

Transcript

  1. Distributed Systems • In Distributed systems things fail independently •

    Conversely things that fail independently are also distributed systems That brings concurrent processing in the purview of distributed systems.
  2. Problem of concurrent access to data List<Object> list = new

    ArrayList<Object> (); for (Object obj : list) { if (condition(obj)) { list.remove(obj); } } list.add(new Object());
  3. Two problem domains: Same solution • What we have seen

    is an example of Snapshot Isolation. • Once we are in that domain, we can pretty much apply techniques suggested by Doug Terry
  4. Self consistent data • We need to separate consistency from

    freshness • As snapshot isolation is also repeatable read, once you read a set of data • It helps preserve invariants
  5. Ensemble Ensemble : A group of items viewed as a

    whole rather than individually. ‘the buildings in the square present a charming provincial ensemble’ Origin Late Middle English (as an adverb (long rare) meaning ‘at the same time’): from French, based on Latin insimul, from in- ‘in’ + simul ‘at the same time’.
  6. Updates Across Bounded Contexts In scalable systems, you can't assume

    transactions for updates across these different entities. A simple test case that counts on atomicity between bounded contexts will usually succeed. Later, when redeployment moves the entities across machines the latent bug emerges; the updates are no longer atomic. You can never count on different entities residing in the same place. A scale-agnostic programming abstraction must have the notion of bounded context as the boundary of atomicity. Understanding boundaries and the clear commitment to a lack of atomicity across boundaries are essential to scale-agnostic programming.
  7. Actors • This style of system modelling typically leads to

    Actor based programming paradigm • It also needs a BFF layer to bridge impedance mismatch between clients and core business logic i.e. Http vs Message Passing style
  8. Process Managers • Known by Different Names ◦ SAGA ◦

    Ochastrator • They are the products offered to consumers
  9. Challenges putting fences Dr Eric Brewer in 12 years of

    CAP Theorem • The subtle beauty of a consistent system is that the invariants tend to hold even when the designer does not know what they are. • Consequently, a wide range of reasonable invariants will work just fine. Conversely, when designers choose A, which requires restoring invariants after a partition, they must be explicit about all the invariants, which is both challenging and prone to error. • At the core, this is the same concurrent updates problem that makes multithreading harder than sequential programming
  10. To sum it all Every writer creates his own precursors.

    His work modifies our conception of the past, as it will modify the future. - Jorge Luis Borges in Kafka and his Precursors