Download - Measuring Micro-services. Richard Rodger
![Page 1: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/1.jpg)
Pulse. Temperature. Blood Pressure. Microservice systems have emergent properties too.
![Page 2: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/2.jpg)
nearForm & microservices 50+ production systems. The good, the bad, and the ugly.
![Page 3: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/3.jpg)
What are Microservices? Independent processes that exchange messages.
![Page 4: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/4.jpg)
Messages are fundamental. Message behaviour has emergent properties.
![Page 5: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/5.jpg)
Message flow rate. Easy to measure. Tells you a lot. Independent of services.
![Page 6: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/6.jpg)
Deploy a new Microservice. Does the new version break anything?
![Page 7: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/7.jpg)
Is your microservice system healthy? Measure changes to message flow rates to find out.
![Page 8: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/8.jpg)
Microservice message patterns. What to measure? Here’s what we’ve found useful…
![Page 9: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/9.jpg)
Actor. A pool of services share message load evenly (round-robin, say).
![Page 10: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/10.jpg)
Subscriber. Many services all listen for the same set of message types.
![Page 11: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/11.jpg)
Chain. An initial message causes a chain of serial message steps.
![Page 12: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/12.jpg)
Tree. An initial message causes a flowering of child messages.
![Page 13: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/13.jpg)
Why? It's the risk, stupid! Monoliths put everybody in danger.
![Page 14: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/14.jpg)
Risk. Reduction can be measured. Leave elimination to Machiavelli.
![Page 15: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/15.jpg)
Our "best practices" for risk. Unit tests; code reviews; standards. Do we have good measures?
![Page 16: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/16.jpg)
We've just made things worse! Microservices also have emergent failure modes.
![Page 17: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/17.jpg)
Let's attack both sides. And we'll find a way to connect both attacks.
Formal Methods
“Best Practices”Measurement
![Page 18: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/18.jpg)
Dynamic measurement. Measure health of the system. Exposes unknown unknowns.
![Page 19: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/19.jpg)
Formal methods. Correctness proofs are impractical. Incomplete execution traces? FTW!
* http://research.microsoft.com/en-us/um/people/lamport/tla/tla.html
TLA+ Leslie Lamport *
![Page 20: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/20.jpg)
Invariants. Some things should never change. Measure them to make sure!
![Page 21: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/21.jpg)
Example. E-commerce shopping cart. add-item msgs == sales-tax msgs
![Page 22: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/22.jpg)
Invariants in practice? Finding invariants is easy: use the microservice patterns to cheat!
![Page 23: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/23.jpg)
Actor. n actors means each actor sees 1⧸n of the messages.
![Page 24: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/24.jpg)
Subscriber. n subscribers means each sees n messages.
![Page 25: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/25.jpg)
Chain. n inbound messages over k links means n k chained messages.
![Page 26: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/26.jpg)
Tree. n inbound messages over k leaves means n k leaf messages.
![Page 27: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/27.jpg)
Look for cause/effect relationships. These are by design! Validate your message patterns in production.
“ask not what can go wrong, ask what must go right…”
Chris Newcombe, AWS*
* http://research.microsoft.com/en-us/um/people/lamport/tla/amazon.html
![Page 28: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/28.jpg)
When should you rollback? Invariants should be the same before and after deployment.
![Page 29: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/29.jpg)
Is the system correct? Business rules are invariants too! Express as message relationships.
![Page 30: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/30.jpg)
Are you about to be blindsided? Combine individual indicators to get a deeper measure of risk.
![Page 31: Measuring Micro-services. Richard Rodger](https://reader031.vdocuments.mx/reader031/viewer/2022021815/58f293e81a28ab456d8b4577/html5/thumbnails/31.jpg)
Measure what counts. Find invariants. Measure them. Follow: senecajs.org