24. www.stelligent.com
Continuous Delivery Fundamentals
Quality = Build it into the product
“Cease dependence on mass inspection to
achieve quality. Improve the process and build
quality into the product in the first place”
-W. Edwards Deming
48. Decomposition Process
• Start with functionality and
capabilities, NOT the data.
• Look at capabilities outside
in. Model services from
customer perspective.
• Avoid anemic CRUD
services.
1. Capabilities Decomposition 2. Data Decomposition 3. Deployment Decomposition
• The capabilities drive the
data decomposition.
• Additional services based
on data access
decomposition
• Data needs to be owned
exclusively by SINGLE
service
• Separating services into
distinct deployables
• Expose APIs
• Decide on integration
methods
49. Step 1 - Capability Cohesion
Code Order
Code
Monolith ServiceMonolith Service
Customer
Code
Monolith
DB
Monolith
DB
49
54. The Anti-Corruption Layer Pattern
Order
Microservice
Account
Microservice
Shipping
Microservice
Monolith
Database
Monolith Application
Order
ACL
Account
ACL
Shipping
ACL
Application Layer
Data Access Layer
DAO Layer, etc.
json
xml
json
java
xml
csv
• Each Anti-Corruption Layer (ACL)
– Translates from New Domain Model to Monolith Domain Model
– Prevents corruption of either domain model
– Often implemented using the Façade and/or Adapter pattern
– Can be built inside or outside the monolith
55. Step 2 - Data Cohesion
Order
Code
Monolith Service
Customer
Code
Order
Code
Monolith Service
Customer
Code
Monolith
DB
Order
DB
Customer
DB
55
56. Encapsulate Data
Foreign Key? Use the service to access data
Order
Order
DB
Customer
DB
Order Customer
Order
DB
Customer
DB
59. Event Based and Eventual Consistency
Order Customer
Customer
DB
Topic
Order
DB
POST /Orders
(including address change)
60. Step 3 - Deployment Cohesion
Order
Code
Microservice
Customer
Code
Order
DB
Customer
DB
Order
Code
Monolith Service
Customer
Code
Order
DB
Customer
DB
Microservice
60
62. Separate Deployments
Independent CD Pipelines
Compile
Unit
Test
Package Deploy
E2E
Test
ProdOrder
Compile
Unit
Test
Package Deploy
E2E
Test
ProdCustomer
Contract
Tests
64. www.stelligent.com
Database Integration Anti-pattern
Order Customer
Customer
DB
• Tight coupling – DB changes require changes
in both services.
• Weak Cohesion – Customer DB code exists
in multiple places.
• Availability – High DB load from one service
will impact the other service.
The benefits…
The challenges…
• Simple – Seems easier and quicker to start.
65. www.stelligent.com
Synchronous Integration
Order Customer
Customer
DB
• Loose Coupling – Customer service can change
independent from Order service.
• Strong Cohesion – Customer DB code exists in
one place.
• Strong Consistency – Order service can react
to downstream failures.
The benefits…
The challenges…
• Availability – Care must be taken to avoid
cascading failures (circuit breakers)
• Contracts – API contract changes must be
versioned to maintain loose coupling.
69. www.stelligent.com
Event-driven Architecture
Order Customer
Customer
DB
• Loose Coupling – Customer service can change
independent from Order service.
• Strong Cohesion – Customer DB code exists in
one place.
• Availability – Order service is not impacted by
Customer service degradation.
The benefits…
The challenges…
• Eventual Consistency – Care must be taken to
achieve consistency in failure conditions
• Contracts – API contract changes must be
versioned to maintain loose coupling.
Topic
71. www.stelligent.com
HATEOAS
Order Customer
• Loose coupling – Customer service URLs can
change without changing client App.
The benefits…
The challenges…
• Complexity – Requires discipline to enforce link
traversal in clients.
Client
App
1) GET /orders/123
2) Order
(with Customer link)
3) GET /customers/456
74. www.stelligent.com 74
Next Steps
• Try mu - https://getmu.io/
• Get support - https://gitter.im/stelligent/mu
• Contribute - https://github.com/stelligent/mu/blob/develop/CONTRIBUTING.md
75. www.stelligent.com
Resources
• Building Microservices, Sam Newman - http://shop.oreilly.com/product/0636920033158.do
• The DevOps Handbook, Gene Kim/Jez Humble/Patrick Debois/John Willis -
http://itrevolution.com/devops-handbook
• mu - https://getmu.io/
75
76. For more information on how Stelligent can help you with AWS Automation, go to www.stelligent.com
Q&A