Top Banner
2
34

Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

May 26, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

2

Page 2: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

1

Page 3: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Pulse. Temperature. Blood Pressure. Micro-service systems have emergent properties too.

Page 4: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

nearForm & micro-services 50+ production systems. The good, the bad, and the ugly.

Page 5: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

What are micro-services? Independent processes that exchange messages.

Page 6: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Messages are fundamental. Message behavior has emergent properties.

Page 7: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Message flow rate. Easy to measure. Tells you a lot. Independent of services.

Page 8: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Deploy a new micro-service. Does the new version break anything?

Page 9: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

To measure changes to services, measure changes to message flow rates.

Page 10: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Micro-service message patterns. What to measure? Here’s what we’ve found useful…

Page 11: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Actor. A pool of services share message load evenly (round-robin, say).

Page 12: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Subscriber. Many services all listen for the same set of message types.

Page 13: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Chain. An initial message causes a chain of serial message steps.

Page 14: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Tree. An initial message causes a flowering of child messages.

Page 15: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Why? It's the risk, stupid! Monoliths put everybody in danger.

Page 16: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Risk. Reduction can be measured. Leave elimination to Machiavelli.

Page 17: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Our "best practices" for risk. Unit tests; code reviews; standards. Do we have good measures?

Page 18: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

We've just made things worse! Microservices also have emergent failure modes.

Page 19: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Let's attack both sides. And we'll find a way to connect both attacks.

Formal Methods

“Best Practices”Measurement

Page 20: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Dynamic measurement. Measure health of the system. Exposes unknown unknowns.

Page 21: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

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 22: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Invariants. Some things should never change. Measure them to make sure!

Page 23: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Example. E-commerce shopping cart. add-item msgs == sales-tax msgs

Page 24: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Be practical! Finding invariants is hard. Use the microservice patterns to cheat.

Page 25: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Actor. n actors means each actor sees 1⧸n of the messages.

Page 26: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Subscriber. n subscribers means each sees n messages.

Page 27: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Chain. n inbound messages over k links means n k chained messages.

Page 28: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Tree. n inbound messages over k leaves means n k leaf messages.

Page 29: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

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 30: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

When should you rollback? Invariants should be the same before and after deployment.

Page 31: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Is the system correct? Business rules are invariants too! Express as message relationships.

Page 32: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Are you about to be blindsided? Combine individual indicators to get a deeper measure of risk.

Page 33: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Measure what counts. Find invariants. Measure them. Follow: senecajs.org

Page 34: Pulse. Temperature. Blood Pressure. - microXchgmicroxchg.io/2015/slides/02_02_richardrodger-micro... · nearForm & micro-services 50+ production systems. The good, the bad, and the

Thank You! Richard Rodger @rjrodger nearform.com