The seven deadly sins of microservices

45
The Seven DEADLY SINS OF Microservices Daniel Bryant @danielbryantuk OpencRedo (WITH Credit to Tareq Abedrabbo)

Transcript of The seven deadly sins of microservices

Page 1: The seven deadly sins of microservices

The Seven DEADLY SINS OF Microservices

Daniel Bryant@danielbryantuk

OpencRedo

(WITH Credit to Tareq Abedrabbo)

Page 2: The seven deadly sins of microservices

The Seven Deadly Sins

1. LUST …

2. GLUTTONY

3. GREED…

4. SLOTH

5. WRATH

6. ENVY

7. PRIDE

24/11/2016 @danielbryantuk

Page 3: The seven deadly sins of microservices

The Seven Deadly Sins (of Microservices)

1. LUST - Using the latest and greatest tech…

2. GLUTTONY - Excessive communication protocols

3. GREED - All your service are belong to us…

4. SLOTH - Creating a distributed monolith

5. WRATH - Blowing up when bad things happen

6. ENVY - The shared single domain fallacy

7. PRIDE - testing in the world of transience

24/11/2016 @danielbryantuk

Page 4: The seven deadly sins of microservices

@danielbryantuk• Chief Scientist at OpenCredo, CTO at SpectoLabs

ü Transforming organisations through technology and teams

ü Agile, Lean, Architecture, CI/CD, DevOps

ü Microservices, cloud, Containers, Java, Go, Docker, Kubernetes

• London Java Community Associate

• Adopt OpenJDK and JSR

• InfoQ Editor, DZone MVB, VOXXED, O'Reilly

24/11/2016 @danielbryantuk

Page 5: The seven deadly sins of microservices

1. Lust - Using THE LATEST and Greatest Tech…24/11/2016 @danielbryantuk

Page 6: The seven deadly sins of microservices

Microservices...

They solve all of our problems, Right?

24/11/2016 @danielbryantuk

Page 7: The seven deadly sins of microservices

No... Not necessarily good for speed

24/11/2016 @danielbryantukskillsmatter.com/skillscasts/6143-microservices-for-speed

AdditionalReading!!martinfowler.com/bliki/

MonolithFirst.html

Page 8: The seven deadly sins of microservices

No... Check your architecture/design skills“If you can't build a [well-structured] monolith,

what makes you think microservices are the answer?”

Simon Brown(bit.ly/1n7D0vp)

24/11/2016 @danielbryantuk

Page 9: The seven deadly sins of microservices

24/11/2016 @danielbryantuk

Page 10: The seven deadly sins of microservices

No... Check your architecture/design skills

24/11/2016 @danielbryantuk

Page 11: The seven deadly sins of microservices

No... Operational maturity is vital

24/11/2016 @danielbryantuk

martinfowler.com/bliki/MicroservicePrerequisites.html

Page 12: The seven deadly sins of microservices

Microservices are very useful

But check your use case...

...Evaluation is a key skill

24/11/2016 @danielbryantuk

Page 13: The seven deadly sins of microservices

Evaluation

“I will postpone using this shiny new framework until my peers have validated the proposed benefits with

rigorous scientific experiments”

- Said by no programmer…ever

24/11/2016 @danielbryantuk

Page 14: The seven deadly sins of microservices

Pick Your (Technical) Battles...…

• As Dan McKinley says, “Choose Boring Technology”– Optimize globally across organisation

• Java and Spring (Boot) are perfectly acceptable

• ... As are tomcat/jetty

24/11/2016 @danielbryantuk

Page 15: The seven deadly sins of microservices

Matt Raible’s Comparison Framework

24/11/2016 @danielbryantuk

Page 16: The seven deadly sins of microservices

2. GLUTTONY - Excessive Communication PROTOCOLS24/11/2016 @danielbryantuk

Page 17: The seven deadly sins of microservices

Standardize Across the Organization

• Choose one synchronous protocol

– e.g. JSON over HTTP

• Choose one asynchronous protocol

– e.g. RabbitMQ

Don’t gold-plate, but know your options: ProtoBuf, Thrift, ZeroMQ, MQTT

24/11/2016 @danielbryantuk

Page 18: The seven deadly sins of microservices

Enterprise communication (Beam me up?)

24/11/2016 @danielbryantuk

www.dzone.com/research/guide-to-enterprise-integration

Page 19: The seven deadly sins of microservices

3. GREED - All your service are Belong to us…24/11/2016 @danielbryantuk

Page 20: The seven deadly sins of microservices

How Do Committees Invent?

“organizations which design systems ... are constrained to produce designs which are copies of the

communication structures of these organizations”

- Melvin Conway, 1968

24/11/2016 @danielbryantuk

Page 21: The seven deadly sins of microservices

24/11/2016 @danielbryantuk

Dev QA Ops

Hand-offdelaysHand-offdelays

Slowfeedback Slowfeedback

Lackofcohesion,sharedunderstandingandjointaccountability

Front-end Database

Middleware24/11/2016 @danielbryantuk

Page 22: The seven deadly sins of microservices

24/11/2016 @danielbryantuk

Page 23: The seven deadly sins of microservices

Technical problems are often people problems...

24/11/2016 @danielbryantuk

bit.ly/1L43U4H

Page 24: The seven deadly sins of microservices

Conway was Telling the Truth... Deal with it!

24/11/2016 @danielbryantuk

Page 25: The seven deadly sins of microservices

Cross-functional Teams

• Spotify (bit.ly/1C46ZKo)– Culture

• Amazon (bit.ly/1F3Dgkm)

– Communication

• Gilt (gi.lt/1rgyWvO)– Strategic alignment

24/11/2016 @danielbryantuk

Page 26: The seven deadly sins of microservices

4. SLOTH - Creating a distributed monolith24/11/2016 @danielbryantuk

Page 27: The seven deadly sins of microservices

Can’t Deploy Services Independently?

Check your ‘bounded contexts’ and/or data ‘fault-lines’

(Also, check you have separated deploy and release)

24/11/2016 @danielbryantuk

Page 28: The seven deadly sins of microservices

Can’t Deploy Services Independently?

• Schema-first design

– Michael Bryzek (Gilt): APIdoc

• Consumer-driven Contracts FTW

– Martin Fowler: CDC - A Service Evolution Pattern

“CDC is BDD for microservices”24/11/2016 @danielbryantuk

Page 29: The seven deadly sins of microservices

Architecture - not a Dirty Word

• Technical leadership (bit.ly/1EUwpLl)

• Communication (bit.ly/1Ia3u8o)

• Promote shared understanding

• ‘Just enough’ up front design

24/11/2016 @danielbryantuk

Page 30: The seven deadly sins of microservices

5. WRATH - Blowing up when bad things happen 24/11/2016 @danielbryantuk

Page 31: The seven deadly sins of microservices

Bring in Michael Nygard (Or some monkeys)

24/11/2016 @danielbryantuk

Page 32: The seven deadly sins of microservices

Distributed computing - your new best friend

• Notes on distributed systems for young bloods– Jeff hodges (bit.ly/1pKVepz)

• 8 Fallacies of distributed computing

– Sun Microsystems, ROTEM-GAL-OZ (bit.ly/1IEpFC0)

• Distributed systems theory for the distributed systems engineer– Henry Robinson (bit.ly/1qcxqZ3)

24/11/2016 @danielbryantuk

Page 33: The seven deadly sins of microservices

OPERATIONAL Concerns: Technical

• Continuous delivery is a microservice prerequisite

– Rapid provisioning

– Basic monitoring

– Rapid application deployment

• I.E. Agile & DevOps

24/11/2016 @danielbryantuk

Page 34: The seven deadly sins of microservices

Operational Concerns: Social

• Failure happens all the time... Get used to it!

• 'Gameday' or 'Disaster in recovery testing' (Real) Scenarios

• Failure injection testing (FIT):

– Building 'Failure as a Service' at Netflix without the Simian Army

24/11/2016 @danielbryantuk

Page 35: The seven deadly sins of microservices

Share the pain...

24/11/2016 @danielbryantuk

Page 36: The seven deadly sins of microservices

“Dev-on-call”An occasional spike to the head

is a good thing...

...metaphorically speaking

• You write it, you run it– Accountability

– Shared responsibility

– Communication

24/11/2016 @danielbryantuk

Page 37: The seven deadly sins of microservices

6. ENVY - The shared SINGLE domain fallacy24/11/2016 @danielbryantuk

Page 38: The seven deadly sins of microservices

One Model to Rule Them All...

• One model…– Breaks encapsulation

– Introduces coupling

• Know your DDD– Entities

– Value Objects

– Aggregates and Roots

24/11/2016 @danielbryantuk

Page 39: The seven deadly sins of microservices

But... how do I generate Reports?

• Aggregated reporting pattern

– Pull by service

• Data Pumps

– Push (Event sourcing?)

24/11/2016 @danielbryantuk

Page 40: The seven deadly sins of microservices

7. PRIDE - testing in the world of transience24/11/2016 @danielbryantuk

Page 41: The seven deadly sins of microservices

People are surprisingly quiet about this...

24/11/2016 @danielbryantukmartinfowler.com/articles/microservice-testing/

Page 42: The seven deadly sins of microservices

Testing With Microservices is Difficult...

• Invest in your build pipeline testing

– Serenity BDD

– Wiremock / Saboteur

– Jenkins Performance plugin

24/11/2016 @danielbryantuk

Page 43: The seven deadly sins of microservices

Testing With Microservices is Difficult...

• Do it in production(?)

– Netflix

– Hailo

– Gilt

• This is an advanced pattern!– Automation is essential!

24/11/2016 @danielbryantuk

Page 44: The seven deadly sins of microservices

Summary

1. LUST - Using the latest and greatest tech…

2. GLUTTONY - Excessive communication protocols

3. GREED - All your service are belong to us…

4. SLOTH - Creating a distributed monolith

5. WRATH - Blowing up when bad things happen

6. ENVY - The shared single domain fallacy

7. PRIDE - testing in the world of transience

24/11/2016 @danielbryantuk

Page 45: The seven deadly sins of microservices

THANKS...

@danielbryantuk

[email protected]

https://www.infoq.com/presentations/7-sins-microservices

(Credit to Tareq Abedrabbo for inspiration/guidance)

24/11/2016 @danielbryantuk