microservices vs. mini vs. monoliths: winner takes all? · •ideally no inter-service...
TRANSCRIPT
JRebel by Perforce © 2019 Perforce Software, Inc.
Microservices vs. Miniservices vs. Monoliths: Winner Takes All? ROD COPE, CTO
jrebel.com 2 | Akana by Perforce © 2019 Perforce Software, Inc.
Rod Cope Bio: • CTO for Rogue Wave Software (now
Perforce) and the Founder and CTO of OpenLogic
• 25+ year software career includes IBM, IBM
Global Services, General Electric, and Anthem Blue Cross/Blue Shield.
• Worldwide event speaker, including: JavaOne, OSCON, Embedded World, ApacheCon, Strata/Big Data, LinuxCon, and API World.
Which is better?
jrebel.com 4 | Akana by Perforce © 2019 Perforce Software, Inc.
Option A: Monolith
jrebel.com 5 | Akana by Perforce © 2019 Perforce Software, Inc.
Option B: Microservices
jrebel.com 6 | Akana by Perforce © 2019 Perforce Software, Inc.
Option C: Miniservices
Monolith
jrebel.com 14 | Akana by Perforce © 2019 Perforce Software, Inc.
jrebel.com 15 | Akana by Perforce © 2019 Perforce Software, Inc.
Component Interaction
http://serena-yeoh.blogspot.com/2014/01/layered-architecture-components.html
jrebel.com 16 | Akana by Perforce © 2019 Perforce Software, Inc.
Three-Tier Architecture
www.SoftwareTestingMaterial.com
jrebel.com 17 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 18 | Akana by Perforce © 2019 Perforce Software, Inc.
Monolith: culture 1
Traditional command and
control
One big team (or devs vs DBAs)
Waterfall-ish
Big design up front, integration
testing
Slow deployment cadence
Vertical scalability
jrebel.com 19 | Akana by Perforce © 2019 Perforce Software, Inc.
Monolith: culture 2
Agile or scaled agile
Feature teams
Frequent, automated integration testing
Horizontal scalability
jrebel.com 20 | Akana by Perforce © 2019 Perforce Software, Inc.
Versioning issues
Latency
Monolith: Advantages
jrebel.com 21 | Akana by Perforce © 2019 Perforce Software, Inc.
Monolith: Advantages 2
jrebel.com 22 | Akana by Perforce © 2019 Perforce Software, Inc.
Monolith: Advantages 3
One
Code base
Set of artifacts
Build process
Language
Platform
Toolchain
jrebel.com 23 | Akana by Perforce © 2019 Perforce Software, Inc.
Monolith: challenges
• No small changes
• Technology lock-in
• Scale all or nothing
• Heavyweight deployment
• Version coordination
• Bug affects entire app
• Container concerns
jrebel.com 24 | Akana by Perforce © 2019 Perforce Software, Inc.
Monolith: Best Practices
• Agile
• DevOps
• Layers and modules
• Horizontal scaling
• Development accelerators
Services
jrebel.com 26 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA: Service-Oriented Architecture
• Service:
• Logical business activity
• Self-contained
• Black box for its consumers
• Distributed, separately-maintained and deployed
• Not SOAP, WS-*, heavy process, central control, vendor lock-in
Microservices
jrebel.com 28 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices in a Nutshell
UNIX PHILOSOPHY: “DO ONE THING AND DO IT WELL”
SOA FOR DISTRIBUTED TEAMS IN A WORLD OF DEVOPS
BOUNDED CONTEXT AND DOMAIN-DRIVEN DESIGN (DDD)
jrebel.com 29 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 30 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 31 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 32 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 33 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices: Characteristics
Processes talking over network
Maybe IPC like shared mem Maybe same process like OSGi
bundles (like Akana)
Independently deployable
Easy to replace Organized around
capabilities (UI, suggestions, billing)
Independent implementation
(language, platform, data)
Small, message enabled, context bounded,
autonomously developed, decentralized
Built and released with automated
processes
Elastic, resilient, composable, minimal, and
complete
jrebel.com 34 | Akana by Perforce © 2019 Perforce Software, Inc.
• Cannot share data storage
• Ideally no inter-service communication via REST/HTTP
• No synchronous communication to prevent cascading timeouts • All async messaging
• Eventual consistency
• Compensating operations
Loosely Coupled
jrebel.com 35 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
jrebel.com 36 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
Strategic goals Project-specific benefit
jrebel.com 37 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
Strategic goals Project-specific benefit
Intrinsic interoperability Custom integration
jrebel.com 38 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
Strategic goals Project-specific benefit
Intrinsic interoperability Custom integration
Shared services (reuse) Specific-purpose implementation
jrebel.com 39 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
Strategic goals Project-specific benefit
Intrinsic interoperability Custom integration
Shared services (reuse) Specific-purpose implementation
Flexibility over optimization Flexibility over optimization
jrebel.com 40 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
Strategic goals Project-specific benefit
Intrinsic interoperability Custom integration
Shared services (reuse) Specific-purpose implementation
Flexibility over optimization Flexibility over optimization
Evolutionary refinement Evolutionary refinement
jrebel.com 41 | Akana by Perforce © 2019 Perforce Software, Inc.
SOA manifesto (2009) Microservices philosophy
Business value Technical strategy
Strategic goals Project-specific benefit
Intrinsic interoperability Custom integration
Shared services (reuse) Specific-purpose implementation
Flexibility over optimization Flexibility over optimization
Evolutionary refinement Evolutionary refinement
jrebel.com 42 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices: Advantages
SMALL PROBLEMS
SMALL TEAMS SMALL SOLUTIONS
BEST TOOLS FOR THE JOB
jrebel.com 43 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices: decisions
Service mesh / proxy
Communication
State management
Coordination
Deployment
Operations
jrebel.com 44 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices: challenges
Distributed computing
01 Cognitive load
02 Service explosion
03 Team dynamics
04
jrebel.com 45 | Akana by Perforce © 2019 Perforce Software, Inc.
Fallacies of Distributed Computing
1. Network is reliable
2. Latency is zero
3. Bandwidth is infinite
4. Network is secure
5. Topology doesn’t change
6. There is one administrator
7. Transport cost is zero
8. Network is homogenous
jrebel.com 46 | Akana by Perforce © 2019 Perforce Software, Inc.
Fallacies of Distributed Computing
1. Network is reliable
2. Latency is zero
3. Bandwidth is infinite
4. Network is secure
5. Topology doesn’t change
6. There is one administrator
7. Transport cost is zero
8. Network is homogenous
jrebel.com 47 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices: culture
Automation
True DevOps
Embrace Failure
jrebel.com 48 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices: Best Practices
• Extreme automation
• Service mesh
• API management
• Monolith first
jrebel.com 49 | Akana by Perforce © 2019 Perforce Software, Inc.
Security
Mediation Transformation Orchestration Traffic
management Analytics
API service
API service
API service
API management
Security
Policies Traffic management Telemetry
Control plane
Service mesh
Microservice
Sidecar
Microservice
Sidecar
Microservice
Sidecar
• External focus
• Central/one
• Security
• Stability
• Internal focus
• Decentral/many
• Availability
• Flexibility
jrebel.com 50 | Akana by Perforce © 2019 Perforce Software, Inc.
Microservices, Service Mesh, and MASA
• Microservice: Bounded context,
independent data store
• Service mesh: Internal
implementation fabric,
coordination
• Gartner MASA: Mesh App and
Service Architecture Gartner
jrebel.com 51 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 52 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 53 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 54 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 55 | Akana by Perforce © 2019 Perforce Software, Inc.
martinfowler.com
jrebel.com 56 | Akana by Perforce © 2019 Perforce Software, Inc.
API & Service Mesh Summary
• API management & service mesh address different needs
• Both critical for microservice architecture
• No one-size-fits-all solution
• Current best of breed:
Commercial API management Open source service mesh
ZUUL
Miniservices
jrebel.com 58 | Akana by Perforce © 2019 Perforce Software, Inc.
Miniservices
• One function
• Bundle of microservices
• Fat container
• Relaxes some constraints • Data store sharing • Sync & HTTP
jrebel.com 59 | Akana by Perforce © 2019 Perforce Software, Inc.
Miniservices
• One function
• Bundle of microservices
• Fat container
• Relaxes some constraints • Data store sharing • Sync & HTTP
jrebel.com 60 | Akana by Perforce © 2019 Perforce Software, Inc.
Miniservices: advantages
Less culture shock
Business value over architectural purity
Traditional web communication
Best tool for the job
jrebel.com 62 | Akana by Perforce © 2019 Perforce Software, Inc.
jrebel.com 63 | Akana by Perforce © 2019 Perforce Software, Inc.
Grok: Mono/ Macro
Mini Micro
Code
Architecture
?
?
✕
Reuse ✕
Change ✕ ?
Deploy ? ?
Versioning ? ✕
jrebel.com 64 | Akana by Perforce © 2019 Perforce Software, Inc.
Conclusion
•One-size-fits-all is wrong
•Consider your needs • Your problem
• Your team
• Your timeframe
jrebel.com 65 | Akana by Perforce © 2019 Perforce Software, Inc.
Questions?
jrebel.com 66 | Akana by Perforce © 2019 Perforce Software, Inc.
Talk to our experts about securing your services of
any size and get a free security-first API strategy
assessment!
Are Your APIs Secure?
Stop by Booth #129