The Seven (More) DEADLY SINS OF Microservices @ danielbryantuk @ - - PowerPoint PPT Presentation

the seven more deadly sins of microservices
SMART_READER_LITE
LIVE PREVIEW

The Seven (More) DEADLY SINS OF Microservices @ danielbryantuk @ - - PowerPoint PPT Presentation

The Seven (More) DEADLY SINS OF Microservices @ danielbryantuk @ spectolabs Previously, AT Devoxx UK & QCON NYC 2015... https://www.infoq.com/presentations/7-sins-microservices 01/05/2017 @danielbryantuk The Seven (more) Deadly Sins of


slide-1
SLIDE 1

The Seven (More) DEADLY SINS OF Microservices

@spectolabs @danielbryantuk

slide-2
SLIDE 2

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

01/05/2017 @danielbryantuk

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

slide-3
SLIDE 3

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

01/05/2017 @danielbryantuk

slide-4
SLIDE 4

@danielbryantuk

  • Software developer, CTO at SpectoLabs
  • Agile, architecture, CI/CD, Programmable infrastructure
  • Java, Go, JS, microservices, cloud, containers
  • Continuous delivery of value through effective technology and teams

01/05/2017 @danielbryantuk

bit.ly/2jWDSF7

slide-5
SLIDE 5
  • 1. Lust - Using THE LATEST and Greatest Tech…

01/05/2017 @danielbryantuk

slide-6
SLIDE 6

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

01/05/2017 @danielbryantuk

developers with new tech be like F*cking new technology...

Credit to Michael Hausenblas

This has been me many times!

slide-7
SLIDE 7

Evaluation is a key skill...

01/05/2017 @danielbryantuk

slide-8
SLIDE 8

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

01/05/2017 @danielbryantuk

slide-9
SLIDE 9

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 deadlock

http://spinemodel.info/explanation/introduction/

slide-10
SLIDE 10

AN example: To containerise, or not to containerise? (dockaH, dockah, dockah... Dockah?)

01/05/2017 @danielbryantuk

slide-11
SLIDE 11

Strategy #fail

01/05/2017 @danielbryantuk

slide-12
SLIDE 12

Architecture/ops: Expectations versus reality

01/05/2017 @danielbryantuk

“DevOps”

slide-13
SLIDE 13

Choices: Beware of Confirmation bias

01/05/2017 @danielbryantuk

https://thehftguy.wordpress.com/2016/11/01/docker-in-production-an-history-of-failure/ http://patrobinson.github.io/2016/11/05/docker-in-production/

slide-14
SLIDE 14

Evaluation - It'S easy to be tricked

01/05/2017 @danielbryantuk

slide-15
SLIDE 15

Evaluation - beware of bias and heuristics

01/05/2017 @danielbryantuk

slide-16
SLIDE 16
  • 2. GLUTTONY - Communication lock-in

01/05/2017 @danielbryantuk

slide-17
SLIDE 17

Rpc - not the devil in disguise

  • We all Like rest and Json, but...
  • Don'T rule out RPC (e.g. grpc)

– the contract (and speed) can be beneficial – Human readability of JSON is

  • ver-rated

01/05/2017 @danielbryantuk

slide-18
SLIDE 18

Delegation of comms operability

01/05/2017 @danielbryantuk blog.christianposta.com/microservices/the-hardest- part-of-microservices-calling-your-services/

slide-19
SLIDE 19

Rpc - not the devil in disguise

  • Sometime events are better

– Asynchronous (AP vs CP) – Event-sourcing, cqrs etc

  • Reactive is everywhere

– And Only getting hotter...

01/05/2017 @danielbryantuk

www.infoq.com/news/2017/03/microliths-microsystems

slide-20
SLIDE 20

The ESB is dead - long live the esb!

01/05/2017 @danielbryantuk

slide-21
SLIDE 21

The ESB is dead - long live the esb!

01/05/2017 @danielbryantuk

slide-22
SLIDE 22

The ESB is dead - long live the esb!

01/05/2017 @danielbryantuk

  • Is this an ESB?
  • Or an API gateway?
slide-23
SLIDE 23

The ESB is dead - long live the API Gateway!

01/05/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

slide-24
SLIDE 24
  • 3. GREED - What'S mine is mine... (within the organisation)…

01/05/2017 @danielbryantuk

slide-25
SLIDE 25

Previously...

  • Conway'S Law
  • Microservices are about people, as much as they are tech

– Maybe more – Particularly in a migration / transformation

01/05/2017 @danielbryantuk

slide-26
SLIDE 26

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

01/05/2017 @danielbryantuk

slide-27
SLIDE 27
  • 4. SLOTH - Getting Lazy with NFRs

01/05/2017 @danielbryantuk

slide-28
SLIDE 28

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

01/05/2017 @danielbryantuk

slide-29
SLIDE 29

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)

01/05/2017 @danielbryantuk

slide-30
SLIDE 30

Getting lazy with NFRs - security

01/05/2017 @danielbryantuk

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

slide-31
SLIDE 31

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

01/05/2017 @danielbryantuk

slide-32
SLIDE 32
  • 5. WRATH - Blowing up when bad things happen

01/05/2017 @danielbryantuk

slide-33
SLIDE 33

Previously - Bring in Michael Nygard (Or some monkeys)

01/05/2017 @danielbryantuk

slide-34
SLIDE 34

When bad things happen, people are always involved

01/05/2017 @danielbryantuk | @oakinger

slide-35
SLIDE 35

People Pain point - How does Devops fit into this?

  • http://web.devopstopologies.com/
  • @ matthewpskelton
  • Books

01/05/2017 @danielbryantuk

slide-36
SLIDE 36

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

01/05/2017 @danielbryantuk

slide-37
SLIDE 37

Devops - define responsibilities

  • Do you really want to build an

entire microservices platform?

  • Focus on what matters

– Ci/CD – Mechanical sympathy – Logging – Monitoring

01/05/2017 @danielbryantuk

slide-38
SLIDE 38

Worth considering: Open source PaaS/FaaS/DBaas

01/05/2017 @danielbryantuk

slide-39
SLIDE 39
  • 6. ENVY - The shared SINGLE domain (and Data Store) fallacy

01/05/2017 @danielbryantuk

slide-40
SLIDE 40

Previously - One Model to Rule Them All...

  • One model…

– Breaks encapsulation – Introduces coupling

  • Know your DDD

– Entities – Value Objects – Aggregates and Roots

01/05/2017 @danielbryantuk

slide-41
SLIDE 41

Context mapping (static) & event storming (dynamic)

01/05/2017 @danielbryantuk | @spoole167 41

www.infoq.com/articles/ddd-contextmapping ziobrando.blogspot.co.uk/2013/11/introducing-event-storming.html

slide-42
SLIDE 42

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

01/05/2017 @danielbryantuk

slide-43
SLIDE 43
  • 7. PRIDE - testing in the world of transience

01/05/2017 @danielbryantuk

slide-44
SLIDE 44

Previously...

  • Local verification

– Consumer-Driven contracts

  • End-to-end

– BDD-style critical path

  • Remember the test pyramid

01/05/2017 @danielbryantuk

martinfowler.com/articles/microservice-testing/

slide-45
SLIDE 45

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 Andrew Morgan'S talk http://bit.ly/2oV0ecD

01/05/2017 @danielbryantuk

slide-46
SLIDE 46

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

01/05/2017 @danielbryantuk

slide-47
SLIDE 47

Hoverfly

  • Lightweight Service virtualisation

– Open source (Apache 2.0) – Go-based / single binary – Written by @Spectolabs

  • Flexible API simulation

– HTTP / HTTPS – Highly performant

01/05/2017 @danielbryantuk

slide-48
SLIDE 48

01/05/2017 @danielbryantuk

  • Middleware
  • Remove PII
  • Rate limit
  • Add headers
  • Middleware
  • Fault injection
  • Chaos monkey
slide-49
SLIDE 49

Hoverfly-Java (Junit support)

01/05/2017 @danielbryantuk

github.com/SpectoLabs/hoverfly-java

slide-50
SLIDE 50

Right, Let'S Wrap this up...

01/05/2017 @danielbryantuk

slide-51
SLIDE 51

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

01/05/2017 @danielbryantuk

slide-52
SLIDE 52

Bedtime reading

01/05/2017 @danielbryantuk

slide-53
SLIDE 53

THANKS... (Don'T forget to rate the talk!)

http://specto.io muservicesweekly.com

(Credit to Tareq Abedrabbo, opencredo for inspiration/guidance)

01/05/2017 @danielbryantuk