Slide 1

Slide 1 text

Lift & Shift, Cut Overs, and other Bad Habits Product Manager [email protected]

Slide 2

Slide 2 text

Agenda - Intro - What are Design Patterns? - Rethinking for the Cloud - Strangler - Publisher/Subscriber - Circuit Breaker - Next Steps

Slide 3

Slide 3 text

Who am I?

Slide 4

Slide 4 text

Who am I?

Slide 5

Slide 5 text

Who am I?

Slide 6

Slide 6 text

What are Design Patterns?

Slide 7

Slide 7 text

7 7 7 A way to express a complex solution to a problem in a simple, repeatable way We do this in many areas - Goldilocks - Catch 22 - Kobayashi Maru What is a Design Pattern?

Slide 8

Slide 8 text

8 8 8 What are some familiar ones?

Slide 9

Slide 9 text

Types of Design Patterns Creational Structural Behavioral Scope Class Factory Adapter Interpreter Object Abstract Factory Adapter Chain of Responsibility Builder Bridge Command Prototype Composite Iterator Singleton Decorator Mediator Facade Observer Flyweight Strategy Proxy Visitor

Slide 10

Slide 10 text

10 10 10 The Old World - Direct access to systems - 3-tier architecture (presentation, app, data) - Simple request/response - Local request/response - Potentially single server - Predictable components & configurations - Complete control over the stack The New(ish) World - DevOps and Build pipelines - Microservices - Distributed systems - Ephemeral systems - Scalable, unpredictable architecture - Predictable configurations - Minimal control for developers Why they break down

Slide 11

Slide 11 text

Our Approaches

Slide 12

Slide 12 text

Lift & Shift: What we Think

Slide 13

Slide 13 text

Lift & Shift: Reality

Slide 14

Slide 14 text

Lift & Shift: Reality

Slide 15

Slide 15 text

Cut Overs: What we Think

Slide 16

Slide 16 text

Cut Overs: Reality

Slide 17

Slide 17 text

Other Ideas - Hybrid: What we Think

Slide 18

Slide 18 text

Other Ideas - Hybrid: Reality

Slide 19

Slide 19 text

Rethinking for the Cloud

Slide 20

Slide 20 text

20 20 20 - Microservices - Distributed Logging - Federated Identity - Load Balancing - Promises - Service Discovery - Service Mesh - Sidecars - Mock Objects - Work Objects What’s out of bounds this time?

Slide 21

Slide 21 text

Disclaimer: These are descriptive, not prescriptive.

Slide 22

Slide 22 text

22 22 22 “If you know the problem and know yourself, you need not fear the result of a hundred releases. If you know yourself but not the problem, for every release you will also suffer downtime. If you know neither the problem nor yourself, you will break everything and have no flippin’ clue why.” ~ Sun Tzu Some Wisdom

Slide 23

Slide 23 text

The Strangler

Slide 24

Slide 24 text

What problem do we have? We have an old system We want to have a new system The old system has to keep working

Slide 25

Slide 25 text

What does this pattern do? Old System Facade Old System Old System Old Facade New Old Facade New New System Facade

Slide 26

Slide 26 text

When do we use it? The old system has to keep working We want to separate/isolate components Great for testing high risk components Ref: https://martinfowler.com/bliki/StranglerFigApplication.html

Slide 27

Slide 27 text

Do you have a single point of entry/control? Now you have to maintain the facade too! Can the facade keep up with the changes? Is the facade a single point of failure? Can both systems handle data jointly? What are the tradeoffs?

Slide 28

Slide 28 text

Blue/Green Deployments Highway Bypasses What does it look like in the wild?

Slide 29

Slide 29 text

Publisher/ Subscriber

Slide 30

Slide 30 text

We have distributed components that need to interact We may not have a list of every listener Not every listener cares about every message What problem do we have?

Slide 31

Slide 31 text

What does this pattern do? Ref: https://learn.microsoft.com/en-us/azure/architecture/patterns/publisher-subscriber

Slide 32

Slide 32 text

When do we use it? We have distributed, event-driven systems We don’t have control over the endpoints We have varied architectures, languages, etc Our listeners are scaling quickly or are ephemeral

Slide 33

Slide 33 text

What are the tradeoffs? Security - there are many ways to screw this up This is a broadcast-only, not bi-directional Messages will be received out of order Messages can be lost or repeated Can you replay messages?

Slide 34

Slide 34 text

What does it look like in the wild? Webhooks!* Airports

Slide 35

Slide 35 text

Circuit Breaker

Slide 36

Slide 36 text

What problem do we have? Things break! Things come back! We have to protect our app and users

Slide 37

Slide 37 text

Protects the system but cutting off - or breaking - connectivity to other systems Optionally: Provide a fallback option Optionally: Monitor the underlying system and recover automatically once it’s restored What does this pattern do? Ref: https://martinfowler.com/bliki/CircuitBreaker.html

Slide 38

Slide 38 text

Any time we want to isolate a dependency/subsystem AND Our system can be “useful enough” without the subsystem When do we use it?

Slide 39

Slide 39 text

Ref: https://aws.amazon.com/blogs/compute/using-the-circuit-breaker-pattern-with-aws-step-functions-and-amazon-dynamodb/ What are the tradeoffs? How do we handle the exceptions? How do we trigger a reset/recovery? How do we test success, failure, and the transition states? Some things should knock our systems offline

Slide 40

Slide 40 text

What does it look like in the wild? Circuit breakers Traffic reports

Slide 41

Slide 41 text

Wrap Up

Slide 42

Slide 42 text

- Design Patterns - complex ideas in simple repeatable explanations - Rethinking for the Cloud - our constraints have changed - Strangler - replace an old system safely over time - Publisher/Subscriber - communicate between distributed systems - Circuit Breaker - protect your system & recover from failures Recap

Slide 43

Slide 43 text

43 43 43 Pulling these together CB old system facade client new system monitoring

Slide 44

Slide 44 text

44 44 44 - Microservices - Distributed Logging - Federated Identity - Load Balancing - Promises - Service Discovery - Service Mesh - Sidecars - Mock Objects - Work Objects Other Cloud Design Patterns

Slide 45

Slide 45 text

45 45 45 Where can I learn more? - Martin Fowler’s Patterns of Legacy Displacement - Microsoft’s Azure Architecture Center - PHP: Design Patterns on LinkedIn - webhooks.fyi - In progress: DesignPatterns.fyi

Slide 46

Slide 46 text

Lift & Shift, Cut Overs, and other Bad Habits Product Manager [email protected]