4. Eberhard Wolff - @ewolff
Microservices: Definition
• Small
• Independent deployment units
• i.e. processes / VM
• Including GUI
• Any technology
• Any infrastructure
Micro
Service
Server
Micro
Service
Server
5. Eberhard Wolff - @ewolff
Components Collaborate
Micro-
service
Micro-
service
Link
Data Replication
REST
Messaging
6. Eberhard Wolff - @ewolff
Online Shop
Order
Catalog
Search
Billing
Customer
HTML /
HTTP
10. Eberhard Wolff - @ewolff
Conway‘s Law
Architecture
copies
communication structures
of the organization
11. Eberhard Wolff - @ewolff
Order Billing Search Catalog
Order CatalogSearchBilling
Team can deploy without integration
Changes can be deployed independently & quickly
Strong & enforced modularization
Technology stack per Microservice
One or many Microservices per Team
Synergy Microservices / Conway’s Law
12. Eberhard Wolff - @ewolff
One team can
build and
deploy features
independently!
13. Eberhard Wolff - @ewolff
Team must be
responsible for
a sensible set
of functionality
15. Eberhard Wolff - @ewolff
DDD
• Domain Driven Design
• By Eric Evans
• UBIQUITOUS LANGUAGE
• Code / database / user should use
the same terms for the domain
model
16. Eberhard Wolff - @ewolff
Bounded Context
• Domain model is only valid for one
context
• There is no universal data model!
• See all failed SOA attempts
17. Eberhard Wolff - @ewolff
Order Shipping Billing
Customer
Loyalty
program #
Customer
Shipping
address
Customer
Credit
Card #
18. Eberhard Wolff - @ewolff
Bounded Context &
Microservice
• Microservice = Bounded Context
• Changes: local
• Even for data model
• Independent development
• Relationship = team collaboration
26. Eberhard Wolff - @ewolff
Code Reuse
• Reuse across technology stacks hard
• Code dependencies are evil!
• Deployment dependency
• No more independent deployment
• Update hell
• Avoid code reuse!
• Or make it Open Source projects (Netflix)
• Service reuse is fine
28. Eberhard Wolff - @ewolff
Global Refactorings?
• Move code from service to service
• Might be a port to a different
language
• Separate in a new service?
• More services = more complex
• Hard
29. Eberhard Wolff - @ewolff
Functional Architecture
• Teams should be independent
• i.e. one team = one functionality
• Otherwise: Coordination hard
• Functional architecture much more
important
31. Eberhard Wolff - @ewolff
Refactoring hard
Functional
architecture much
more important
32. Eberhard Wolff - @ewolff
Need to get
architecture
right first time
Architecture
evolves
33. Eberhard Wolff - @ewolff
Start BIG
• Won’t have too much code at the
start anyway
• Refactoring easier
• Can build architecture as you go
• Let the functional architecture
grow!
35. Eberhard Wolff - @ewolff
1st Law of Distributed Objects
• Don’t Distribute Your Objects!
• Too much remote communication &
overhead
• Lesson learned from CORBA etc
• Microservice should include a GUI
• http://martinfowler.com/bliki/
FirstLaw.html
37. Eberhard Wolff - @ewolff
1st Law of Distributed Objects &
Microservices
• Small Microservices mean a lot of
communication
• Violate the 1st Law
• Seems to work, though
• http://martinfowler.com/articles/
distributed-objects-
microservices.html
39. Eberhard Wolff - @ewolff
Resilience
• Failures must not propagate
• Timeouts
• Bulkheads
• Circuit Breaker
• Michael T. Nygard: Release It!
• Implementation: Hystrix (Netflix)
• More robust than monoliths!
40. Eberhard Wolff - @ewolff
Authentication & Authorization
• Centralized authentication
• Service must authorize user
• More complex than monolith
• E.g. OAuth2
42. Eberhard Wolff - @ewolff
Component Model
• No restriction on language etc
• Individual processes
• + infrastructure (database etc)
• JARs, WARs, EARs: No good fit
• Standardized Monitoring
• Standardized Logging
44. Eberhard Wolff - @ewolff
Operation
• Common standards must be
enforced
• Templates simplify creating new
Microservices
• …avoid too large Microservices
• …and support common standards
46. Eberhard Wolff - @ewolff
Conclusion: Microservices
• Microservices are a new way of
modularization
• More technological freedom
• Architecture to enable scaling agile
• Easier, faster and less risky
deployment
47. Eberhard Wolff - @ewolff
Issues
• Refactoring and reuse hard
• Distributed systems
• More sources of failures
48. Eberhard Wolff - @ewolff
Use If…
• Time to market is important
• Sustained development speed
• Large enough project
49. Eberhard Wolff - @ewolff
Don’t Use If…
• Infrastructure complexity cannot be
handled
• Architectural complexity cannot be
handled