Top Banner
The Seven (More) DEADLY SINS OF Microservices @opencredo Daniel Bryant @danielbryantuk
53

Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Apr 15, 2017

Download

Technology

Daniel Bryant
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The Seven (More) DEADLY SINS OF Microservices

@opencredo

Daniel Bryant @danielbryantuk

Page 2: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Previously, AT Devoxx UK & QCON NYC 2015...

24/03/2017 @danielbryantukhttps://www.infoq.com/presentations/7-sins-microservices

Page 3: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The Seven (more) Deadly Sins of Microservices

1. LUST - Using the (Unevaluated) latest and greatest tech…

2. GLUTTONY - Communication lock-in

3. GREED - What'S Mine is mine (within the organisation)…

4. SLOTH - Getting lazy with NFRs

5. WRATH - Blowing up when bad things happen

6. ENVY - The shared single domain (and data store) fallacy

7. PRIDE - testing in the world of transience

24/03/2017 @danielbryantuk

Page 4: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

@danielbryantuk

• Chief Scientist at OpenCredo, CTO at SpectoLabs• Agile, architecture, CI/CD, Programmable infrastructure

• Java, Go, JS, microservices, cloud, containers

• Continuous delivery of value through effective technology and teams

24/03/2017 @danielbryantuk

bit.ly/2jWDSF7

Page 5: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

1. Lust - Using THE LATEST and Greatest Tech…24/03/2017 @danielbryantuk

Page 6: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

New technology is great... Until it isn'T

24/03/2017 @danielbryantuk

developers with new tech be like

F*cking new technology...

Credit to Michael Hausenblas

Thishasbeenmemanytimes!

Page 7: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Evaluation is a key skill...

24/03/2017 @danielbryantuk

Page 8: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Evaluation - are Microservices A good fit?• “our 'mode TWO' apps are Microservices”

– Middle-management latch on to Buzzword

– New app evolution limited by existing system

– Lipstick on the pig

• Not understanding architecture principles– Not building around business Functionality

– Creating Mini-monoliths (no twelve factors)

• No Well-defined DevOps / SRE / Ops– Deployment/ops free-for-all

24/03/2017 @danielbryantuk

Page 9: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Evaluation of tech - The’Spine Model• Effective conversations make for effective

collaboration

• It's a TOOL Problem– As a species, we have always been Tool users

and makers.

– We use _____ to get our work done

• People get stuck in a dilemma where equally plausible options are available

• “Going up the Spine” breaks deadlockhttp://spinemodel.info/explanation/introduction/

Page 10: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

AN example: To containerise, or not to containerise?

(dockaH, dockah, dockah... Dockah?)

24/03/2017 @danielbryantuk

Page 11: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Strategy #fail

24/03/2017 @danielbryantuk

Page 12: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Architecture/ops: Expectations versus reality

24/03/2017 @danielbryantuk

“DevOps”

Page 13: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Choices: Beware of Confirmation bias

24/03/2017 @danielbryantukhttps://thehftguy.wordpress.com/2016/11/01/docker-in-production-an-history-of-failure/ http://patrobinson.github.io/2016/11/05/docker-in-production/

Page 14: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Evaluation - It'S easy to be tricked

24/03/2017 @danielbryantuk

Page 15: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Evaluation - beware of bias and heuristics

24/03/2017 @danielbryantuk

Page 16: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

2. GLUTTONY - Communication lock-in24/03/2017 @danielbryantuk

Page 17: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Rpc - not the devil in disguise

• Don'T rule out RPC (e.g. grpc)

– Sometimes the contract (and speed) are beneficial

– Human readability of JSON can be over-rated

• Sometime events are better

– Asynchronous (AP vs CP)

– Event-sourcing, cqrs, reactive systems

24/03/2017 @danielbryantuk

Page 18: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Jonas Boner'S thoughts

24/03/2017 @danielbryantuk

www.infoq.com/news/2017/03/microliths-microsystemswww.slideshare.net/jboner/from-microliths-to-microsystems

Page 19: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The ESB is dead - long live the esb!

24/03/2017 @danielbryantuk

Page 20: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The ESB is dead - long live the esb!

24/03/2017 @danielbryantuk

Page 21: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The ESB is dead - long live the esb!

24/03/2017 @danielbryantuk

• Is this an ESB?

• Or an API gateway?

Page 22: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The ESB is dead - long live the API Gateway!

24/03/2017 @danielbryantuk

• Watch for the API Gateway morphing into an Enterprise service bus– Loose coupling is vital

• But let me be clear...– The API Gateway pattern is awesome

– Centralise cross-cutting concerns

– Prevent wheel-reinvention (plugins)

– Check out kong, apigee, Mulesoft etc

Page 23: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

3. GREED - What'S mine is mine... (within the organisation)…

24/03/2017 @danielbryantuk

Page 24: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Previously...

• Conway'S Law

• Microservices are about people, as much as they are tech

– Maybe more

– Particularly in a migration / transformation

24/03/2017 @danielbryantuk

Page 25: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

We hear this a lot...

“We’ve decided to reform our teams around squads, chapters and guilds”

• Beware of cargo-culting

– Repeat three times “We are not spotify”

• Understand the practices, principles, values etc

24/03/2017 @danielbryantuk

Page 26: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

4. SLOTH - Getting Lazy with NFRs24/03/2017 @danielbryantuk

Page 27: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Getting lazy with non-Functional Requirements

“The driving technical requirements for a system should be identified early

to ensure they are properly handled in subsequent design”

Aidan Casey

Guiding principles for evolutionary architecture

24/03/2017 @danielbryantuk

Page 28: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Getting lazy with non-Functional Requirements

• The 'ilities' Can be (often) be an afterthought

– Availability, Scalability, auditability, testability etc

• Agile/Lean: Delay decisions to the ‘last responsible moment’– NewsFlash - Sometimes this is up-front

• It can be costly (or prohibitive) to adapt late in the project

– Microservices don'T make this easier (sometimes more difficult)

24/03/2017 @danielbryantuk

Page 29: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Getting lazy with NFRs - security

24/03/2017 @danielbryantuk

www.slideshare.net/spnewman/appsec-microservices-velocity-2016 www.infoq.com/news/2016/08/secure-docker-microservices

Page 30: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Testing NFRs in the build pipeline

• Performance and Load testing – Gatling / jmeter

– Flood.io

• Security testing – Findsecbugs / OWASP Dependency check

– Bdd-security (OWASP ZAP) / Arachni

– Gauntlt / Serverspec

– Docker Bench for Security / Clair

24/03/2017 @danielbryantuk

Page 31: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

5. WRATH - Blowing up when bad things happen 24/03/2017 @danielbryantuk

Page 32: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Previously - Bring in Michael Nygard (Or some monkeys)

24/03/2017 @danielbryantuk

Page 33: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

When bad things happen, people are always involved

24/03/2017 @danielbryantuk|@oakinger

Page 34: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

People Pain point - How does Devops fit into this?

• http://web.devopstopologies.com/

• @matthewpskelton

• @beerops and @sigje

• Google SRE

24/03/2017 @danielbryantuk

Page 35: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Devops - the 'fullstack engineer' myth

“I'M sorry, but if you'RE not designing the computer chips and

writing the website, then I don'T wanna hear from you”

Charity Majors (@mipsytipsy), CraftConf 2016

http://www.ustream.tv/recorded/86181845

24/03/2017 @danielbryantuk

Page 36: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Devops - define responsibilities

• Do you really want to build an entire microservices platform?

• Focus on what matters

– Ci/CD

– Mechanical sympathy

– Logging

– Monitoring

24/03/2017 @danielbryantuk

Page 37: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Worth considering: Open source PaaS

24/03/2017 @danielbryantuk

Page 38: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

6. ENVY - The shared SINGLE domain (and Data Store) fallacy

24/03/2017 @danielbryantuk

Page 39: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Previously - One Model to Rule Them All...

• One model…– Breaks encapsulation

– Introduces coupling

• Know your DDD– Entities

– Value Objects

– Aggregates and Roots

24/03/2017 @danielbryantuk

Page 40: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Context mapping (static) & event storming (dynamic)

24/03/2017 @danielbryantuk|@spoole167 40

www.infoq.com/articles/ddd-contextmapping

ziobrando.blogspot.co.uk/2013/11/introducing-event-storming.html

Page 41: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Choose (and use) data stores appropriately

• RDBMS– Valuable for structured data

• Cassandra is Awesome– but don'T treat it like an RDBMS!

• Don'T build a graph with RDBMS– Use neo4j, Titan etc

• Beware of operational overhead

24/03/2017 @danielbryantuk

Page 42: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

7. PRIDE - testing in the world of transience24/03/2017 @danielbryantuk

Page 43: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Previously...

• Local verification

– Consumer-Driven contracts

• End-to-end

– BDD-style critical path

• Remember the test pyramid

24/03/2017 @danielbryantuk

martinfowler.com/articles/microservice-testing/

Page 44: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Service virtualisation / API simulation

• Virtualise request/response of services

– Unavailable

– Expensive to run

– Fragile/brittle

– Non-deterministic

– Cannot simulate failures

https://dzone.com/articles/continuously-delivering-soa

24/03/2017 @danielbryantuk

Page 45: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Service virtualisation

• Classics

– CA service virtualization

– Parasoft virtualize

– HPE service virtualization

– IBM Test Virtualization server

• New (open source) kids on the block

– Hoverfly

– Wiremock

– VCR/Betamax

– Mountebank

– mirage

24/03/2017 @danielbryantuk

Page 46: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Hoverfly

• Lightweight Service virtualisation

– Open source (Apache 2.0)

– Go-based / single binary

– Written by @Spectolabs

• Flexible API simulation

– HTTP / HTTPS

– Highly performant

24/03/2017 @danielbryantuk

Page 47: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

24/03/2017 @danielbryantuk

• Middleware• RemovePII• Ratelimit• Addheaders

• Middleware• Faultinjection• Chaosmonkey

Page 48: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Hoverfly-Java (Junit support)

24/03/2017 @danielbryantuk

github.com/SpectoLabs/hoverfly-java

Page 49: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Right, Let'S Wrap this up...

24/03/2017 @danielbryantuk

Page 50: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The Seven (more) Deadly Sins of Microservices

1. LUST - Using the (Unevaluated) latest and greatest tech…

2. GLUTTONY - Communication lock-in

3. GREED - What'S Mine is mine (within the organisation)…

4. SLOTH - Getting lazy with NFRs

5. WRATH - Blowing up when bad things happen

6. ENVY - The shared single domain (and data store) fallacy

7. PRIDE - testing in the world of transience

24/03/2017 @danielbryantuk

Page 51: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

The Seven (more) Deadly Sins of Microservices

1. LUST - Using the (Unevaluated) latest and greatest tech…

2. GLUTTONY - Communication Lock-in

3. GREED - What'S Mine is mine (within the organisation)…

4. SLOTH - Getting lazy with NFRs

5. WRATH - Blowing up when bad things happen

6. ENVY - The shared single domain (and data store) fallacy

7. PRIDE - testing in the world of transience

24/03/2017 @danielbryantuk

Page 52: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

Bedtime reading

24/03/2017 @danielbryantuk

Page 53: Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"

THANKS...

www.opencredo.com

muservicesweekly.com

(Credit to Tareq Abedrabbo for inspiration/guidance)

24/03/2017 @danielbryantuk