Microservices: Service Oriented Development
Total Page:16
File Type:pdf, Size:1020Kb
Microservices: Service Oriented Development Rafael Schloming How do I break up my monolith? How do I architect my app with microservices? What infrastructure do I need in place before I can benefit from microservices? datawire.io 2 Microservices at Datawire ... ● Building a cloud application using microservices in 2013 ● Distributed systems engineers ● Multiple services ● Prototyping was really fast ● … then we launched and things slowed down… datawire.io 3 Debugging Velocity (or lack thereof) datawire.io 4 Tooling Architecture Process!!! datawire.io 5 Debugging our Pipeline datawire.io 6 Velocity comes from Process, not Architecture datawire.io 7 Service Oriented Architecture Service Oriented Development datawire.io 8 Stability/Maturity Velocity Prototype Production Mission critical datawire.io 9 Stability/Maturity Velocity Prototype Production Mission critical datawire.io 10 A single process is inefficient (Forces a single Stability vs Velocity Tradeoff) datawire.io 11 Code Test Define Release Prod datawire.io 12 Code Test Define Centralized process ● Specialized teams ● Fixed policies (e.g., release criteria) Release Prod datawire.io 13 A single process doesn’t scale datawire.io 14 How do I break up my monolith? How do I break up my process? datawire.io 15 Microservices lets you run multiple processes! datawire.io 16 Microservices is a distributed development architecture workflow. datawire.io 17 ● How do I get to Continuous Deployment incrementally? ● How do I limit the scope of PCI (audit process)? ● How do I ship feature X as fast as possible? Stability/Maturity Velocity Prototype Production Mission critical datawire.io 18 Microservices is ... ● Multiple workflows ○ Including your existing workflow! ○ Workflows designed for different stability/velocity tradeoffs ● Simultaneous workflows datawire.io 19 Doing things this way shifts how people operate! ● Requires both organizational and technical changes datawire.io 20 Organizational Implementation datawire.io 21 You gotta give in order to get Education ● Everyone exposed to full dev cycle Communication ● Nobody speaks the same language Delegation ● Small teams own big important parts datawire.io 22 But you get a lot Education ● Specialists become generalists -> Better holistic systems ● Learning, personal growth -> Job satisfaction Communication ● Conflict -> Collaboration Delegation ● Massive organizational scale datawire.io 23 Create self-sufficient, autonomous software teams. datawire.io 24 Why self-sufficiency and autonomy? ● Self-sufficient ○ Team does not need to rely on other teams to achieve its goals ● Autonomy ○ Team is able to independently make (process) decisions on how to achieve its goals datawire.io 25 Eliminate centralized specialist functions Centralized infrastructure / ops* Centralized architecture (You might need a platform team) datawire.io 26 Think Spinoff datawire.io 27 Monolith datawire.io 28 Microservice Monolith Team datawire.io 29 Technical Implementation datawire.io 30 The Workflows Production Users Prototype Mission Critical Stage & Growth Add Features Fast Feedback & from both Stability Goals Don’t Disrupt Tools & Users Users datawire.io 31 One Platform, Parallel Workflows, Seamless Transitions Stage 1: Rapid Stage 1: Rapid Stage 3: Internal Stage development, Stage 2: Users Stage 3: Internal development,Stage 1: Rapid Stage 2: Users users, coupling early users users,Stage coupling 3: Internal earlydevelopment, users StageProduction 2: Users Users Prototype users,Mission coupling Critical early users & Growth Minimal Minimal No cascade Goals Doesn’t crash... disruption to No cascade Doesn’t crash... disruptionMinimalAdd Featuresto failures... Fast Feedback users... failures...No cascade Doesn’t crash... users...disruption& to from both failures...Stability users...Don’t Disrupt Tools & Users Users datawire.io 32 Kubernetes / Docker / Envoy give you the infra you need datawire.io 33 How do I actually use these technologies to build my workflows? datawire.io 34 Stage 1: Prototyping Goal: Fast Feedback from both Tools and Users Org Problem: You need buy-in for prototyping in production Tech Problem: You can’t run microservices locally datawire.io 35 Strategy: Self Service Provisioning & Development Containers datawire.io 36 Provide fast self-service provisioning Make this fast and easy! ● Too much friction leads to accidental coupling datawire.io 37 Problem: Coding on remote infra is slow... VM based pipeline: ● Deploy time: maybe 45 minutes? Docker based pipeline: ● Deploy time: maybe a few minutes? Hacking react on my laptop with live reload: ● Maybe 1-2 seconds? Hacking flask on my laptop with live reload: ● Instantaneous datawire.io 38 How can we do better? datawire.io 39 Develop inside a container Helps with onboarding and jumping between services: ● Single source of truth for build & dependencies ● Consistent and portable dev environment You can make a faster feedback loop: 1. Sync local files -> remote build 2. Sync local files -> local build; snapshot image; deploy in seconds 3. Sync local files -> local build; proxy into remote cluster Shameless self promotion: ● See https://forge.sh for (2) and https://telepresence.io for (3) datawire.io 40 Fast Deploy == Resilience datawire.io 41 Stage 2: Production Users & Growth Goal: Add Features & Don’t Disrupt Users Org Problems: Recognize the Tradeoff & How to measure user impact Tech Problem: Software Bugs datawire.io 42 Strategy: Genetic Diversity (Multiversion Deployment) datawire.io 43 Multiple versions for software redundancy Primary version End user Canary version Dev version datawire.io 44 Stage 3: Mission Critical Goal: Stability Org Problem: Avoid regressing Tech Problem: L7 Observability datawire.io 45 Strategy: Service Level Objectives & L7 Observability datawire.io 46 Cascade Failures A B C X D E datawire.io 47 Summary 1. Start with: “How do I break up my monolithic process?” 2. Spinoff self sufficient & autonomous teams 3. Build awesome tooling for Service Oriented Development datawire.io 48 Thank you! ● [email protected] ● If you want to learn more about these ideas, check out our hands-on tutorial here: ○ https://datawire.io/faster ● If you’re interested in any of our open source tools, check them out: ○ https://forge.sh for deployment ○ https://www.telepresence.io for real-time live coding ○ https://www.getambassador.io self-service API Gateway built on Envoy datawire.io 49 END.