OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"
-
Upload
daniel-bryant -
Category
Technology
-
view
637 -
download
0
Transcript of OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"
![Page 1: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/1.jpg)
The Seven (More) DEADLY SINS OF Microservices
Daniel Bryant
@danielbryantuk
OpencRedo / Spectolabs
![Page 2: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/2.jpg)
Previously, AT Devoxx UK & QCON NYC 2015...
16/10/2016 @danielbryantukhttps://www.infoq.com/presentations/7-sins-microservices
![Page 3: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/3.jpg)
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
16/10/2016 @danielbryantuk
![Page 4: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/4.jpg)
@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
16/10/2016 @danielbryantuk
![Page 5: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/5.jpg)
So, What is a microservice?
“Loosely coupled service oriented architecture with bounded contexts”
Adrian Cockcroft
“Applications that fit in your head”James Lewis
16/10/2016 @danielbryantuk
![Page 6: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/6.jpg)
1. Lust - Using THE LATEST and Greatest Tech…16/10/2016 @danielbryantuk
![Page 7: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/7.jpg)
New technology is great... Until it isn'T
16/10/2016 @danielbryantuk
developers with new tech be like
F**king new technology...
Credit to Michael Hausenblas
Thishasbeenmemanytimes!
![Page 8: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/8.jpg)
Evaluation is a critical skill
• Systematic, transparent, and thorough (Fit for purpose)
• Open source makes this even more important
– Plethora of open source technologies and tools
– Easy to try and move on (for better or worse)
– Open source knowledge must also be evaluated
16/10/2016 @danielbryantuk
![Page 9: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/9.jpg)
Evaluation - are Microservices A good fit?• Not understanding principles (Cargo-culting)
– Not building around business Functionality
– Creating Mini-monoliths (no twelve factors)
• “our 'mode TWO' apps are Microservices”– SOE evolution limited by SOR
– Lipstick on the pig
• No Well-defined DevOps / SRE / Ops– Deployment/ops free-for-all
16/10/2016 @danielbryantuk
![Page 10: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/10.jpg)
18/10/2016 @danielbryantuk
![Page 11: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/11.jpg)
Evaluation - are Microservices A good fit?
17/10/2016 @danielbryantuk
speakerdeck.com/acolyer/making-sense-of-it-all http://www.slideshare.net/dbryant_uk/ctos-in-london-the-challenges-of-evaluating-development-technology-within-the-csuite
![Page 12: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/12.jpg)
Evaluation of tech - Fitness functions
• Great for evaluation and documentation
– Platforms / Language
– Middleware
– Data stores
• Microservices as an Evolutionary Architecture
– Neal Ford and Rebecca Parsons
16/10/2016 @danielbryantuk
![Page 13: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/13.jpg)
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 14: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/14.jpg)
Evaluation - It'S easy to be tricked
16/10/2016 @danielbryantuk
![Page 15: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/15.jpg)
Evaluation - beware of bias and heuristics
16/10/2016 @danielbryantuk
![Page 16: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/16.jpg)
2. GLUTTONY - Communication lock-in16/10/2016 @danielbryantuk
![Page 17: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/17.jpg)
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 is over-rated
• Stick to rest (JSON over HTTPS) on the front-end
– Principle of least surprise
– Best support in Javascript/mobile
16/10/2016 @danielbryantuk
![Page 18: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/18.jpg)
The ESB is dead - long live the esb!
16/10/2016 @danielbryantuk
![Page 19: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/19.jpg)
The ESB is dead - long live the esb!
16/10/2016 @danielbryantuk
![Page 20: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/20.jpg)
The ESB is dead - long live the esb!
16/10/2016 @danielbryantuk
• Is this an ESB?
• Or an API gateway?
![Page 21: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/21.jpg)
The ESB is dead - long live the API Gateway!
16/10/2016 @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 22: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/22.jpg)
3. GREED - What'S mine is mine... (within the organisation)…
16/10/2016 @danielbryantuk
![Page 23: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/23.jpg)
Previously...
• Conway'S Law
• Microservices are about people, as much as they are tech
– Maybe more
– Particularly in a migration / transformation
16/10/2016 @danielbryantuk
![Page 24: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/24.jpg)
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
16/10/2016 @danielbryantuk
![Page 25: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/25.jpg)
Empathy - The Hidden ingredient in Good software development
16/10/2016 @danielbryantuk
www.ustream.tv/recorded/86154111
![Page 26: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/26.jpg)
4. SLOTH - Getting Lazy with NFRs16/10/2016 @danielbryantuk
![Page 27: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/27.jpg)
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
16/10/2016 @danielbryantuk
![Page 28: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/28.jpg)
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)
16/10/2016 @danielbryantuk
![Page 29: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/29.jpg)
Getting lazy with NFRs - security
16/10/2016 @danielbryantuk
www.slideshare.net/spnewman/appsec-microservices-velocity-2016 www.infoq.com/news/2016/08/secure-docker-microservices
![Page 30: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/30.jpg)
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 / AQUA
16/10/2016 @danielbryantuk
![Page 31: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/31.jpg)
5. WRATH - Blowing up when bad things happen 16/10/2016 @danielbryantuk
![Page 32: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/32.jpg)
Previously - Bring in Michael Nygard (Or some monkeys)
16/10/2016 @danielbryantuk
![Page 33: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/33.jpg)
When bad things happen, people are always involved
16/10/2016 @danielbryantuk|@oakinger
![Page 34: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/34.jpg)
People Pain point - How does Devops fit into this?
• http://web.devopstopologies.com/
• @matthewpskelton
• @beerops and @sigje
• Google SRE
16/10/2016 @danielbryantuk
![Page 35: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/35.jpg)
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
16/10/2016 @danielbryantuk
![Page 36: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/36.jpg)
Devops - define responsibilities
• Do you really want to build an entire microservices platform?
• Focus on what matters
– Ci/CD
– Mechanical sympathy
– Logging
– Monitoring
16/10/2016 @danielbryantuk
![Page 37: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/37.jpg)
Open source PaaS
16/10/2016 @danielbryantuk
![Page 38: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/38.jpg)
6. ENVY - The shared SINGLE domain (and Data Store) fallacy
16/10/2016 @danielbryantuk
![Page 39: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/39.jpg)
Previously - One Model to Rule Them All...
• One model…– Breaks encapsulation
– Introduces coupling
• Know your DDD– Entities
– Value Objects
– Aggregates and Roots
16/10/2016 @danielbryantuk
![Page 40: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/40.jpg)
Context mapping (static) & event storming (dynamic)
16/10/2016 @danielbryantuk|@spoole167 40
www.infoq.com/articles/ddd-contextmapping
ziobrando.blogspot.co.uk/2013/11/introducing-event-storming.html
![Page 41: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/41.jpg)
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
16/10/2016 @danielbryantuk
![Page 42: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/42.jpg)
7. PRIDE - testing in the world of transience16/10/2016 @danielbryantuk
![Page 43: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/43.jpg)
Previously...
• Local verification
– Consumer-Driven contracts
• End-to-end
– BDD-style critical path
• Remember the test pyramid
16/10/2016 @danielbryantuk
martinfowler.com/articles/microservice-testing/
![Page 44: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/44.jpg)
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
16/10/2016 @danielbryantuk
![Page 45: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/45.jpg)
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
16/10/2016 @danielbryantuk
![Page 46: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/46.jpg)
Hoverfly
• Lightweight Service virtualisation
– Open source (Apache 2.0)
– Go-based / single binary
– Written by @Spectolabs
• Flexible API simulation
– HTTP / HTTPS
– Highly performant
16/10/2016 @danielbryantuk
![Page 47: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/47.jpg)
16/10/2016 @danielbryantuk
• Middleware• RemovePII• Ratelimit• Addheaders
• Middleware• Faultinjection• Chaosmonkey
![Page 48: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/48.jpg)
Hoverfly JUnit rule
16/10/2016 @danielbryantuk
![Page 49: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/49.jpg)
Right, Let'S Wrap this up...
16/10/2016 @danielbryantuk
![Page 50: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/50.jpg)
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 (txns and ops)
6. ENVY - The shared single domain (and data store) fallacy
7. PRIDE - testing in the world of transience
16/10/2016 @danielbryantuk
![Page 51: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/51.jpg)
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 (txns and ops)
6. ENVY - The shared single domain (and data store) fallacy
7. PRIDE - testing in the world of transience
16/10/2016 @danielbryantuk
![Page 52: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/52.jpg)
Bedtime reading
16/10/2016 @danielbryantuk
![Page 53: OSCON EU 2016 "Seven (More) Deadly Sins of Microservices"](https://reader031.fdocuments.in/reader031/viewer/2022021813/5888ad031a28ab80248b51cd/html5/thumbnails/53.jpg)
THANKS...
@danielbryantuk
http://muservicesweekly.com/
(Credit to Tareq Abedrabbo for inspiration/guidance)
16/10/2016 @danielbryantuk