microservices vs. mini vs. monoliths: winner takes all? · •ideally no inter-service...

66
JRebel by Perforce © 2019 Perforce Software, Inc. Microservices vs. Miniservices vs. Monoliths: Winner Takes All? ROD COPE, CTO

Upload: others

Post on 22-May-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

JRebel by Perforce © 2019 Perforce Software, Inc.

Microservices vs. Miniservices vs. Monoliths: Winner Takes All? ROD COPE, CTO

Page 2: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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.

Page 3: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

Which is better?

Page 4: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 4 | Akana by Perforce © 2019 Perforce Software, Inc.

Option A: Monolith

Page 5: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 5 | Akana by Perforce © 2019 Perforce Software, Inc.

Option B: Microservices

Page 6: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 6 | Akana by Perforce © 2019 Perforce Software, Inc.

Option C: Miniservices

Page 7: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All
Page 8: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All
Page 9: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All
Page 10: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All
Page 11: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All
Page 12: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All
Page 13: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

Monolith

Page 14: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 14 | Akana by Perforce © 2019 Perforce Software, Inc.

Page 15: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 15 | Akana by Perforce © 2019 Perforce Software, Inc.

Component Interaction

http://serena-yeoh.blogspot.com/2014/01/layered-architecture-components.html

Page 16: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 16 | Akana by Perforce © 2019 Perforce Software, Inc.

Three-Tier Architecture

www.SoftwareTestingMaterial.com

Page 17: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 17 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 18: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 19: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 20: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 20 | Akana by Perforce © 2019 Perforce Software, Inc.

Versioning issues

Latency

Monolith: Advantages

Page 21: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 21 | Akana by Perforce © 2019 Perforce Software, Inc.

Monolith: Advantages 2

Page 22: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 22 | Akana by Perforce © 2019 Perforce Software, Inc.

Monolith: Advantages 3

One

Code base

Set of artifacts

Build process

Language

Platform

Toolchain

Page 23: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 24: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 24 | Akana by Perforce © 2019 Perforce Software, Inc.

Monolith: Best Practices

• Agile

• DevOps

• Layers and modules

• Horizontal scaling

• Development accelerators

Page 25: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

Services

Page 26: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 27: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

Microservices

Page 28: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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)

Page 29: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 29 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 30: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 30 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 31: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 31 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 32: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 32 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 33: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 34: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 35: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 35 | Akana by Perforce © 2019 Perforce Software, Inc.

SOA manifesto (2009) Microservices philosophy

Business value Technical strategy

Page 36: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 36 | Akana by Perforce © 2019 Perforce Software, Inc.

SOA manifesto (2009) Microservices philosophy

Business value Technical strategy

Strategic goals Project-specific benefit

Page 37: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 38: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 39: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 40: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 41: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 42: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 42 | Akana by Perforce © 2019 Perforce Software, Inc.

Microservices: Advantages

SMALL PROBLEMS

SMALL TEAMS SMALL SOLUTIONS

BEST TOOLS FOR THE JOB

Page 43: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 43 | Akana by Perforce © 2019 Perforce Software, Inc.

Microservices: decisions

Service mesh / proxy

Communication

State management

Coordination

Deployment

Operations

Page 44: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 44 | Akana by Perforce © 2019 Perforce Software, Inc.

Microservices: challenges

Distributed computing

01 Cognitive load

02 Service explosion

03 Team dynamics

04

Page 45: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 46: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 47: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 47 | Akana by Perforce © 2019 Perforce Software, Inc.

Microservices: culture

Automation

True DevOps

Embrace Failure

Page 48: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 48 | Akana by Perforce © 2019 Perforce Software, Inc.

Microservices: Best Practices

• Extreme automation

• Service mesh

• API management

• Monolith first

Page 49: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 50: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 51: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 51 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 52: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 52 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 53: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 53 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 54: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 54 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 55: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 55 | Akana by Perforce © 2019 Perforce Software, Inc.

martinfowler.com

Page 56: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 57: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

Miniservices

Page 58: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 59: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 60: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 60 | Akana by Perforce © 2019 Perforce Software, Inc.

Miniservices: advantages

Less culture shock

Business value over architectural purity

Traditional web communication

Page 61: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

Best tool for the job

Page 62: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 62 | Akana by Perforce © 2019 Perforce Software, Inc.

Page 63: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 63 | Akana by Perforce © 2019 Perforce Software, Inc.

Grok: Mono/ Macro

Mini Micro

Code

Architecture

?

?

Reuse ✕

Change ✕ ?

Deploy ? ?

Versioning ? ✕

Page 64: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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

Page 65: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

jrebel.com 65 | Akana by Perforce © 2019 Perforce Software, Inc.

Questions?

Page 66: Microservices vs. Mini vs. Monoliths: Winner Takes All? · •Ideally no inter-service communication via REST/HTTP •No synchronous communication to prevent cascading timeouts •All

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