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

Distributed Systems Are a UX Problem

Tyler Treat
October 30, 2018

Distributed Systems Are a UX Problem

Distributed systems are not strictly an engineering problem. It’s far too easy to assume a backend development concern, but the reality is there are implications at every point in the stack. Often the trade-offs we make lower in the stack in order to buy responsiveness bubble up to the top—so much, in fact, that it rarely doesn’t impact the application in some way.

Distributed systems affect the user. We need to shift the focus from system properties and guarantees to business rules and application behavior. We need to understand the limitations and trade-offs at each level in the stack and why they exist. We need to assume failure and plan for recovery. We need to start thinking of distributed systems as a UX problem.

Tyler Treat looks at distributed systems through the lens of user experience, observing how architecture, design patterns, and business problems all coalesce into UX. Tyler also shares system design anti-patterns and alternative patterns for building reliable and scalable systems with respect to business outcomes.

Topic include:

- The “truth” can be prohibitively expensive: When does strong consistency make sense, and when does it not? How do we reconcile this with application UX?
- Failure as an inevitability: If we can’t build perfect systems, what is “good enough”?
- Dealing with partial knowledge: Systems usually operate in the real world (e.g., an inventory application for a widget warehouse). How do we design for the “disconnect” between the real world and the system?

Tyler Treat

October 30, 2018
Tweet

More Decks by Tyler Treat

Other Decks in Programming

Transcript

  1. @tyler_treat Distributed Systems Are a
 UX Problem Tyler Treat /

    O’Reilly Software Architecture Conference / October 30, 2018
  2. @tyler_treat …other than when I’m the user, I know when

    my experience is good and when it’s bad.
  3. @tyler_treat book trip Microservices Airline Service Hotel Service Car Service

    Trip Service transaction transaction transaction ACID ACID ACID
  4. @tyler_treat A Study of Transparency and Adaptability of Heterogeneous Computer

    Networks with TCP/IP and IPv6 Protocols
 Das, 2012 “Any change in a computing system, such as a new feature or new component, is transparent if the system after change adheres to previous external interface as much as possible while changing its internal behavior.”
  5. @tyler_treat Types of Transparencies Access transparency Location transparency Migration transparency

    Relocation transparency Replication transparency Concurrent transparency Failure transparency Persistence transparency Security transparency
  6. @tyler_treat book trip Microservices Airline Service Hotel Service Car Service

    Trip Service transaction transaction transaction Transparency
  7. @tyler_treat book trip Microservices Airline Service Hotel Service Car Service

    Trip Service transaction transaction transaction ACID ACID ACID Transparency
  8. @tyler_treat book trip 2PC Prepare Airline Service Hotel Service Car

    Service Trip Service propose propose propose
  9. @tyler_treat book trip 2PC Commit Airline Service Hotel Service Car

    Service Trip Service commit/abort commit/abort commit/abort
  10. @tyler_treat Problems with 2PC • Chatty protocol: beholden to network

    latency • Limited throughput • Transaction coordinator: single point of failure • Blocking protocol: susceptible to deadlock
  11. @tyler_treat book trip 2PC Prepare Airline Service Hotel Service Car

    Service Trip Service propose propose propose
  12. @tyler_treat book trip 2PC Prepare Airline Service Hotel Service Car

    Service Trip Service propose propose propose
  13. @tyler_treat book trip 2PC Prepare Airline Service Hotel Service Car

    Service Trip Service propose propose propose
  14. @tyler_treat Unless every service is backed by the same database,

    you probably still have to deal with consistency problems.
  15. @tyler_treat Challenges to Adopting Stronger Consistency at Scale
 Ajoux et

    al., 2015 “The biggest barrier to providing stronger consistency guarantees…is that the consistency mechanism must integrate consistency across many stateful services.”
  16. @tyler_treat Sagas
 Garcia-Molina & Salem, 1987 “A long-lived transaction is

    a saga if it can be written as a sequence of transactions that can be interleaved with other transactions…Either all the transactions in a saga are successfully completed or compensating transactions are run to amend a partial execution.”
  17. @tyler_treat Sagas
 Garcia-Molina & Salem, 1987 “A long-lived transaction is

    a saga if it can be written as a sequence of transactions that can be interleaved with other transactions…Either all the transactions in a saga are successfully completed or compensating transactions are run to amend a partial execution.”
  18. @tyler_treat T1 , T2 , . . . , Tn

    T1 , T2 , . . . , Tj , Cj , . . . , C2 , C1 Sagas guarantee one of two execution sequences:
  19. @tyler_treat book trip Airline Service Hotel Service Car Service Trip

    Service transaction transaction transaction
  20. @tyler_treat • Book flight • Book hotel • Book car

    • Charge money T = T1 , T2 , . . . , Tn
  21. @tyler_treat book trip Airline Service Hotel Service Car Service Trip

    Service transaction transaction transaction
  22. @tyler_treat Sean T. Allen “People don’t want distributed transactions, they

    just want the guarantees that distributed transactions give them.”
  23. @tyler_treat CAP Theorem • Consistency, Availability, Partition Tolerance • When

    a partition occurs, do we: • Choose availability and give up consistency?
 
 - or - • Choose consistency and give up availability?
  24. @tyler_treat CAP Theorem • Consistency, Availability, Partition Tolerance • When

    a partition occurs, do we: • Choose availability and give up consistency?
 
 - or - • Choose consistency and give up availability? (or YOLO it)
  25. @tyler_treat …or we can choose availability by making local decisions

    with the knowledge at hand and designing the UX accordingly.
  26. @tyler_treat Check value
 < $10,000? Our risk appetite can drive

    business rules. Clear locally Double check with
 all replicas before
 clearing yes no
  27. @tyler_treat It becomes less about trying to build the perfect

    system and more about how we cope with an imperfect one.
  28. @tyler_treat ACID distributed transactions exactly-once delivery ordered delivery serializable isolation

    linearizability System Properties negative account balance Business Rules / Application Invariants two users sharing same ID room double-booked balance reconciles
  29. @tyler_treat References • https://gotocon.com/dl/goto-chicago-2015/slides/CaitieMcCaffrey_ApplyingTheSagaPattern.pdf • http://ijcsits.org/papers/vol2no62012/42vol2no6.pdf • http://steve.vinoski.net/pdf/IEEE-Convenience_Over_Correctness.pdf • https://queue.acm.org/detail.cfm?id=2745385

    • https://www.enterpriseintegrationpatterns.com/docs/IEEE_Software_Design_2PC.pdf • http://www-db.cs.wisc.edu/cidr/cidr2009/Paper_133.pdf • https://bravenewgeek.com/distributed-systems-are-a-ux-problem/ • http://www.cs.princeton.edu/~wlloyd/papers/challenges-hotos15.pdf • https://www.cs.cornell.edu/andru/cs711/2002fa/reading/sagas.pdf • https://www.youtube.com/watch?v=lsKaNDj4TrE • Starbucks photo - https://www.geekwire.com/2015/starbucks-mobile-ordering-now-blankets-the-u-s-with-coverage-in-san-francisco-new-york-and-more-coming-today/ • Friction image - https://byjus.com/physics/friction-in-automobiles/ • Carbon copy forms - http://www.rainiercopy.com/forms.html • Rosetta Stone photo - https://en.wikipedia.org/wiki/Rosetta_Stone#/media/File:Rosetta_Stone.JPG