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

Gall's Law applied to Distributed System - Ruby Conf Brazil 2021

Gall's Law applied to Distributed System - Ruby Conf Brazil 2021

https://online.rubyconf.com.br/

Gall’s Law states that any complex system that works, evolved from a simple system that also worked. I'll show you practical examples of how to start small and let complexity grow as needed. Sharing how we identified the hints for improvement, and the techniques and tools that supported it.

Fabricio Buzeto

July 30, 2021
Tweet

More Decks by Fabricio Buzeto

Other Decks in Technology

Transcript

  1. In love with code since 2002 Entrepreneur since 2005 Researcher

    since 2008 Startuping since 2011 CTO @ bxblue Fabricio Buzeto a.k.a Fabs
  2. “ A complex system that works is invariably found to

    have evolved from a simple system that worked. “ Gall’s Law John Gall - 1975 “Systemantics: How Systems Really Work and How They Fail.”
  3. “ A complex system that works is invariably found to

    have evolved from a simple system that worked. “ Gall’s Law John Gall - 1975 “Systemantics: How Systems Really Work and How They Fail.”
  4. 1. Any living cell with 2 or 3 neighbors survives

    2. Any dead cell with 3 living neighbors comes to life 3.Any remaining living cell dies Game of Life John Conway - 1970
  5. “ A simple system may or may not work. “

    Gall’s Law Continuing John Gall - 1975 “Systemantics: How Systems Really Work and How They Fail.”
  6. What’s “working” A software that works, is a software that

    fulfil its purpose What a working software does?
  7. Who needs it? - The User ← - The Sponsor

    - The Company - The Team Whos is the Client? Who we need this?
  8. “ A complex system designed from scratch never works and

    cannot be patched up to make it work. You have to start over with a working simple system. “ Gall’s Law Continuing John Gall - 1975 “Systemantics: How Systems Really Work and How They Fail.”
  9. bxblue the first years Unbounce Google Docs Unbounce Google Docs

    Rails Unbounce Pipedrive Rails Google Spreadsheet s MongoDB Pipedrive Rails Would users want to transfer their balance? How do loans are sold? How can we convert better? How can we control it properly?
  10. Simple to Develop Simple to Test Simple to Deploy Simple

    to Reuse Simple to Scale* The monolith Simple like that Chris Richardson https://microservices.io/patterns/monolithic.html
  11. Hard to Scale: - Tests - Team - Deploy -

    Stack - Changes The monolith Drawbacks Chris Richardson https://microservices.io/patterns/monolithic.html
  12. Automate your tools - Tests - Code Quality - Deploy

    - Monitoring Don’t trust yourself Trust the machine
  13. Automate your tasks Tests Code Quality Deploy Unit Tests Commons

    Integration Coverage Linter Code Quality CI/CD Monitoring Source Control Cloud Pipeline Errors Servers Logs Speed Security Journey
  14. Automate your tasks Tests Unit Tests Commons Integration Speed Ensure

    features works as expected Tests contexts are reusable and repeatable Ensure features work together Ensure feedback is contant
  15. Code Quality Automate your tasks Coverage Linter Code Quality Security

    Ensure tests cover enough of the codebase Let the machine ensure style Let the machine ensure simple rules Let the machine ensure simple breaches
  16. Deploy CI/CD Source Control Cloud Pipeline Automate your tasks Ensure

    it works before deploying Good code is produced in groups Deploy cadence leads to faster feedback
  17. Monitoring Errors Servers Logs Journey Automate your tasks Be aware

    of where, when and what is breaking Be aware of how your infrastructure is reacting Have the proper means to investigate issues Follow your users in order to help them
  18. Automate your tasks - bxblue Tests Code Quality Deploy rspec

    factorybot VCR simplecov rubocop reek LayerCI Monitoring Github Heroku Sentry New Relic Logentries Knapsack breakman Posthog
  19. They run on multiple servers. They manage data. Distributed Systems

    What does it mean for a system to be distributed? Unmesh Joshi - 2020 https://martinfowler.com/articles/patterns-of-distributed-systems/
  20. Simple, self-contained, loosely coupled, single focused, services Microservices Miniservices as

    well Chris Richardson https://microservices.io/patterns/monolithic.html
  21. Large, self-contained, Monolith Supported by, small single focused, problem specific,

    services The Citadel Monolith Town DHH - 2020 https://m.signalvnoise.com/the-majestic-monolith-can-become-the-citadel/
  22. Simple, self-contained, context-focused, multi-purpose services Macroservices Hungry Microservices Nitesh Gupta

    - 2020 https://dzone.com/articles/micro-service-mini-service-and-macro-service
  23. Rails bxblue the later years +15 MongoDB Pipedrive Sidekiq backoffice

    MongoDB Sidekiq 5 anti-fraud MongoDB Sidekiq 7
  24. 1. Almost all the successful microservice stories have started with

    a monolith that got too big and was broken up 2. Almost all the cases where I've heard of a system that was built as a microservice system from scratch, it has ended up in serious trouble. Monolith First Martin Fowler - 2015 https://martinfowler.com/bliki/MonolithFirst.html
  25. 1. A more common approach is to start with a

    monolith and gradually peel off microservices at the edges. 2. Another route is to start with just a couple of coarse-grained services, larger than those you expect to end up with. Sacrificial Architecture Often the best code you can write now is code you'll discard in a couple of years time Martin Fowler - 2014 https://martinfowler.com/bliki/SacrificialArchitecture.html
  26. Service-enabled applications They are available to integrate and scale with

    others Stonehenge One step further onto Macro Services
  27. Every application has an inherent amount of complexity that cannot

    be removed or hidden Complexity has to go somewhere Law of conservation of complexity Larry Tesler ~ 1980 http://www.designingforinteraction.com/tesler.html
  28. A distributed monolith, due to poorly designed services, suffer from

    inefficient reuse, low cohesion, high coupling, and weak service contracts. With the Distributed Monolith Be Careful José Neto - 2021 https://medium.com/quintoandar-tech-blog/how-we-planned-fo r-monolith-decomposition-at-quintoandar-363f160b4427
  29. 30% of files 25% of classes 5%~10% of methods Don’t

    let the zombies bite you Dead Code Simone Romano and Giuseppe Scanniello - 2018 http://www.cs.wm.edu/~denys/pubs/TSE'18-DeadCode.pdf
  30. 70% of Companies will fail until 20 months after last

    fundraising* * for seed round or crowdfunded companies death rate is 97% Dead Products CBInsights - 2020 https://www.cbinsights.com/research/startup-failure-post-mortem/
  31. A simple system may or may not work. A complex

    system designed from scratch never works and cannot be patched up to make it work. Gall’s Law A complex system that works is invariably found to have evolved from a simple system that worked. John Gall - 1975 “Systemantics: How Systems Really Work and How They Fail.”
  32. Automate your tools - Tests - Code Quality - Deploy

    - Monitoring Don’t trust yourself Trust the machine
  33. “The simplest solution is usually the best” It’s all Distributed

    Systems Decision making is hard Things will change Why Stonegenge? friar William of Ockham 1287–1347 Occam’s razor