Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Distributed Systems principles

615 views

Published on

SDN Presentation

Als je werkt met mobile devices, UI frameworks zoals AngularJS, WebAPI, messaging, publish/subscribe, etc, dan bouw je een gedistribueerd systeem. Componenten binnen je systeem staan verspreid en communiceren asynchroon. Hier komen allerlei nieuwe uitdagingen bij kijken. In deze sessie kijken we naar enkele theorieën van gedistribueerde systemen om je aan het denken te zetten over de systemen die je bouwt. Aan bod komen o.a. het CAP Theorem, Eventual Consistency, Distributed Transactions, het ‘2 generals’ principe, idem potency, etc. en waarom dit belangrijk is voor jouw applicaties.

Published in: Technology
  • Be the first to comment

Distributed Systems principles

  1. 1. Dennis van der Stelt of distributed systems Dennis van der Stelt Software Architect http://dennis.bloggingabout.net/ dennis@bloggingabout.net NServiceBus Community Champ PRINCIPLES @dvdstelt #sdnevent
  2. 2. Dennis van der Stelt YOUR PRESENTER Dennis van der Stelt http://dennis.bloggingabout.net/ Software Architect Professional Services Provides coaching & training About Dennis Innovative software architect Almost 20 years of experience in development of distributed systems. Has a continuous drive to learn and improve knowledge in different architectural styles, including quality in software development. Highly motivated to share his knowledge via articles, presentations and his blog. Awards NServiceBus Champ Typemock MVP Certified Trainer • Presentations • Software & Architecture audits • SOA & Microservices advice • Unit Testing training • NServiceBus training Presentations October 15th at Blaak Selectie / Betabit Reliable systems using messaging
  3. 3. Dennis van der Stelt AGENDA
  4. 4. Dennis van der Stelt A monolithic design is characterized by such tight coupling among modules that they really have no independent existence. monolithic
  5. 5. Dennis van der Stelt MONOLITHIC DESIGN How does my clean code become a big ball of mud? Database
  6. 6. Dennis van der Stelt MONOLITHIC DESIGN How does my clean code become a big ball of mud? Database
  7. 7. Dennis van der Stelt
  8. 8. Dennis van der Stelt What’s your problem, dude?
  9. 9. Dennis van der Stelt PROBLEM STATEMENT Layering Problem #1
  10. 10. Dennis van der Stelt
  11. 11. Dennis van der Stelt lightweight servicebus
  12. 12. Dennis van der Stelt PROBLEM STATEMENT “little computers passing messages” Problem #2 alan kay http://bit.ly/alankay-oo
  13. 13. reduce coupling
  14. 14. Dennis van der Stelt SpatialTemporalPlatform coupling aspects
  15. 15. Dennis van der Stelt TEMPORAL Store Front End Shipping Service
  16. 16. Dennis van der Stelt TEMPORAL Store Front End Shipping ServiceShipping Service
  17. 17. Dennis van der Stelt TEMPORAL Store Front End Shipping ServiceOrder Queue
  18. 18. Dennis van der Stelt TEMPORAL Store Front End Shipping ServiceOrder Queue
  19. 19. Dennis van der Stelt TEMPORAL Store Front End Shipping ServiceOrder Queue
  20. 20. Dennis van der Stelt Messaging  Reduces spatial coupling  Solves platform coupling  Asynchronous for temporal coupling
  21. 21. Dennis van der Stelt CAP Theorem Eric Brewer, PODC Conference 2000
  22. 22. Dennis van der Stelt CAP THEOREM You can only pick 2
  23. 23. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability
  24. 24. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability
  25. 25. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability distributed system partition tolerantconsistencyavailability
  26. 26. Dennis van der Stelt CAP THEOREM You can only pick 2 centralized system partition tolerantconsistencyavailability distributed system partition tolerantconsistencyavailability when there’s network partition, which do you sacrifice?
  27. 27. Dennis van der Stelt Match the business perspective
  28. 28. Dennis van der Stelt
  29. 29. Dennis van der Stelt
  30. 30. Dennis van der Stelt
  31. 31. Dennis van der Stelt But I can’t drop consistency!
  32. 32. Dennis van der Stelt Basically Available BASE What is BASE? Soft state Eventually consistent
  33. 33. Dennis van der Stelt Eventual Consistency Because 100% consistency isn’t the only option
  34. 34. Dennis van der Stelt
  35. 35. Dennis van der Stelt Eventual Consistency
  36. 36. Dennis van der Stelt Eventual Consistency
  37. 37. Dennis van der Stelt Eventual Consistency your “enterprise” is already eventual consistent with reality
  38. 38. Dennis van der Stelt Eventual Consistency your “enterprise” is already eventual consistent with reality
  39. 39. Dennis van der Stelt “Allow things to be inconsistent and find ways to compensate for mistakes, versus trying to prevent mistakes altogether.” EVENTUAL CONSISTENCY Eric Brewer VP of Infrastructure at Google, Professor at UC Berkeley
  40. 40. Dennis van der Stelt Some ideas on messaging
  41. 41. Dennis van der Stelt 100% synchronized that‘s eventual consistency. Udi Dahanin 2010
  42. 42. Dennis van der Stelt Distributed Transactions Are they as evil as you think? Perhaps even more?
  43. 43. Dennis van der Stelt Who uses distributed transactions?
  44. 44. Dennis van der Stelt using (var scope = new TransactionScope())) { var queue = new MessageQueue(@".Private$Customers"); var message = queue.Receive(); var con = new SqlConnection(); var cmd = new SqlCommand("update customers ..."); cmd.ExecuteNonQuery(); } DISTRIBUTED TRANSACTIONS Microsoft Distributed Transaction Coordinator (MSDTC) Code
  45. 45. Dennis van der Stelt using (var scope = new TransactionScope())) { var queue = new MessageQueue(@".Private$Customers"); var message = queue.Receive(); var con = new SqlConnection(); var cmd = new SqlCommand("update customers ..."); cmd.ExecuteNonQuery(); } DISTRIBUTED TRANSACTIONS Microsoft Distributed Transaction Coordinator (MSDTC) Code MSDTC
  46. 46. Dennis van der Stelt
  47. 47. Dennis van der Stelt Distributed Transactions
  48. 48. Dennis van der Stelt49 Idempotency Once and only once delivery is hard!
  49. 49. Dennis van der Stelt
  50. 50. Dennis van der Stelt IDEM POTENCY Solving the distributed transactionissues Sender {0C836F44-6587-416E-B97A-5615615600D5}
  51. 51. Dennis van der Stelt IDEM POTENCY Solving the distributed transactionissues Sender {0C836F44-6587-416E-B97A-5615615600D5}
  52. 52. Dennis van der Stelt IDEM POTENCY Solving the distributed transactionissues Sender Event Subscriber {5EDC4993-AB01-4F17-A238-71C4521F750F} {0C836F44-6587-416E-B97A-5615615600D5}
  53. 53. Dennis van der Stelt IDEM POTENCY Solving the distributed transactionissues Sender Event Subscriber {5EDC4993-AB01-4F17-A238-71C4521F750F} {0C836F44-6587-416E-B97A-5615615600D5}
  54. 54. Dennis van der Stelt
  55. 55. Dennis van der Stelt find me. http://dennis.bloggingabout.net dvdstelt@outlook.com

×