There has been a bit of hype lately around microservices and all you hear is how awesome microservices architecture is. This talk is about challenges: things you don't normally hear when developers talk about microservices
1. Microservices:
lessons from the trenches
Team Lead at ThoughtWorks
Mehdi Khalili
twitter: @MehdiKhalili
http://www.mehdi-khalili.com/presentations/microservices-lessons-
dddmel/
http://www.mehdi-khalili.com/microservices-lessons/
28. you need the big picture
Correlation Id Service From Timestamp Message
0a669422-5e44 Registration::Creat
e
nil 02 Aug 2014 19:55:15 AEST
+10:00
bbbe64ab-c84c Accounting::Create User::AddAccount 01 Aug 2014 05:10:01 AEST
+10:00
996a3975-4996 Accounting::Create Registration::Create 02 Aug 2014 19:55:16 AEST
+10:00
e30e4e37-b1e1 Avatar::Create Registration::Create 02 Aug 2014 19:55:16 AEST
+10:00
NullReferenc
e
55. Fault tolerance
• Contain the failure
• Caching, data duplication and graceful degradation
• Guaranteed delivery and eventual consistency
• Be proactive about failure
• Monitoring
• Use extensive logging
56. Loose coupling
• You need the big picture
• Self documenting application
• Build-time contract verification
• Consumer Driven Contracts
• Service Libraries
60. benefits vs overheads
Scalability
Operations &
monitoring
Loose coupling Contract violation
Fault tolerance Fault isolation
Scalable development
Communication
overhead
Lower cognitive load Losing the big picture
Tech diversification
Too many things to
learn
Continuous delivery DevOps culture
61. do it to the extent its
benefits outweigh
overheads and challenges
62. Next time you want to do microservices
• Do you actually need it?
• Do you need it now?
• Are the challenges worth the benefits?
• Does it fit your CULTURE?
We see something awesome and we get really excited about it and think I want to be like that. I want to do that
Assume everything your system talks to is broken and write it so it can cope!
Don't wait for it to fail
to expose the error count, response times, up time, transaction per second
simulate an action or path that a customer or end-user would take.
functionality, availability, and response time measures
Don't wait for it to fail
We were getting exception on an endpoint because it was missing a param
Create on the edge service and pass it on to all services
We were missing the big picture
Promotes bad api design
fallbacks, caching
Publish the lib on build time and verify the consumers on CI
Too chatty
Had to deploy a few services each time
Eventual consistency was a pain
Very chatty
Transaction boundaries
Req/Res
Fault isolation
Eventual consistency
Asynchrony
Who’s in charge of auth?
What happens when a new service is created?
Create the cheapest MVP
Doesn’t matter how technically good you are. You can’t win the cultural battle
This actually shows one of the bigger risks with microservices: when it hurts, it really hurts!!
Had to revert my unit tests!!
Long manual release processes with sign-offs and approval gates
Configuration drift
Unfair on your ops team to monitor many services
Is your dev team ready to be on-call?