From macro to micro goto
-
Upload
sam-newman -
Category
Technology
-
view
547 -
download
2
description
Transcript of From macro to micro goto
From Macro To Micro
Sam Newman ThoughtWorks
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Durability
@samnewman#gotoaar
Technology
@samnewman#gotoaar
Geography
@samnewman#gotoaar
Team Structure & Organisation
@samnewman#gotoaar
Speed Of Change
@samnewman#gotoaar
http://bit.ly/GeeCon2012SamN
@samnewman#gotoaar
What makes a good service?
@samnewman#gotoaar
High Cohesion
@samnewman#gotoaar
Loose Coupling
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Bounded Context
@samnewman#gotoaar
"The delimited applicability of a particular model. BOUNDING CONTEXTS gives team members a clear and shared understanding of what has to be consistent and what can develop independently."
@samnewman#gotoaar
A specific responsibility enforced by explicit boundaries
!
http://www.sapiensworks.com/blog/post/2012/04/17/DDD-The-Bounded-Context-Explained.aspx
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Add to cart
@samnewman#gotoaar
Add to cart
Checkout
@samnewman#gotoaar
Add to cart
Checkout
View Latest Releases
@samnewman#gotoaar
Add to cart
Checkout
View Latest Releases
Search
@samnewman#gotoaar
Add to cart
Checkout
View Latest Releases
Search
Listen To Previews
@samnewman#gotoaar
Add to cart
CheckoutView Latest
Releases
Search
Listen To Previews
@samnewman#gotoaar
Add to cart
CheckoutView Latest
Releases
Search
Listen To Previews
Shopping Cart Catalog
Music Library
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
MusikShopMono
@samnewman#gotoaar
MusikShopMono
Warehouse Finance
Catalog Recommendation
@samnewman#gotoaar
That was the easy bit
@samnewman#gotoaar
Enter the DB
@samnewman#gotoaar
@samnewman#gotoaar
DB
MusikShopMono
@samnewman#gotoaar
DB Schema
Recomendation Service
MusicShopMono
@samnewman#gotoaar
DB Schema
Recomendation ServiceMusicShopMono
@samnewman#gotoaar
DB Schema
Recomendation ServiceMusicShopMono
@samnewman#gotoaar
DB
MusikShopMono
Warehouse Finance
Catalog Recommendation
Repository
@samnewman#gotoaar
DB
MusikShopMono
Warehouse Finance
Catalog Recommendation
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Catalog
MusikShopMono
@samnewman#gotoaar
Catalog
Line Items
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Finance
Line Items Ledger
MusikShopMono
@samnewman#gotoaar
Catalog Service Finance Service
MusikShop System
@samnewman#gotoaar
Catalog Service Finance Service
MusikShop System
@samnewman#gotoaar
Catalog Service Finance Service
MusikShop System
Line Items
@samnewman#gotoaar
Catalog Service Finance Service
MusikShop System
Line Items Ledger
@samnewman#gotoaar
Catalog Service Finance Service
MusikShop System
Line Items Ledger
/sku/185
@samnewman#gotoaar
Catalog
Finance
Warehouse
Country Codes
MusikShopMono
@samnewman#gotoaar
Catalog
FinanceWarehouse
Country Codes
Country Codes
Country Codes
MusikShopMono
@samnewman#gotoaar
Catalog
FinanceWarehouse
MusikShopMono
@samnewman#gotoaar
Finance Warehouse
Customer Record
MusikShopMono
@samnewman#gotoaar
reify
@samnewman#gotoaar
@samnewman#gotoaar
Finance Warehouse
Customer Record
MusikShop
@samnewman#gotoaar
Finance Warehouse
Customer Record
Customer
MusikShop
@samnewman#gotoaar
Warehouse ServiceFinance Service
MusikShop System
Customer Service
@samnewman#gotoaar
Catalog Warehouse
Item
MusikShop
@samnewman#gotoaar
Catalog Warehouse
Item
MusikShop
Bee Gees Hits | $4.99 | 45
@samnewman#gotoaar
Catalog Warehouse
Item
MusikShop
Bee Gees Hits | $4.99 | 45
@samnewman#gotoaar
Catalog Warehouse
Item
MusikShop
Bee Gees Hits | $4.99 | 45
@samnewman#gotoaar
Catalog Warehouse
Catalog Item
MusikShop
Stock Levels
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
DB
@samnewman#gotoaar
DB
Cost Of Change
@samnewman#gotoaar
@samnewman#gotoaar
Microservices
@samnewman#gotoaar
UNIX Way
@samnewman#gotoaar
“This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface”
- Douglas McIlroy!
@samnewman#gotoaar
@samnewman#gotoaar
Rule of Modularity: Developers should build a program out of simple parts connected by well defined interfaces, so problems are local, and parts of the program can be replaced in future versions to support new features. This rule aims to save time on debugging complex code that is complex, long, and unreadable.
@samnewman#gotoaar
Rule of Simplicity: Developers should design for simplicity by looking for ways to break up program systems into small, straightforward cooperating pieces. This rule aims to discourage developers’ affection for writing “intricate and beautiful complexities” that are in reality bug prone programs.
@samnewman#gotoaar
Rule of Parsimony: Developers should avoid writing big programs. This rule aims to prevent overinvestment of development time in failed or suboptimal approaches caused by the owners of the program’s reluctance to throw away visibly large pieces of work. Smaller programs are not only easier to optimize and maintain; they are easier to delete when deprecated.
@samnewman#gotoaar
ls
@samnewman#gotoaar
ls | grep “Sam”
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
200 lines of code
@samnewman#gotoaar
Basket
@samnewman#gotoaar
Login
Basket
@samnewman#gotoaar
Login
Basket
Registration
@samnewman#gotoaar
Login
Basket
Recommendation
Registration
@samnewman#gotoaar
Login
Basket
Registration
Recommendation - Now With Added
Clojure!
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Test!
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Alert!!!
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
UP
@samnewman#gotoaar
DOWN
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
UP?
@samnewman#gotoaar
UP? DOWN?
@samnewman#gotoaar
Number >> Size
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
@samnewman#gotoaar
Summary
- Identify your bounded contexts
- Understand the cost of change - and do just enough up front thinking!
- This is an incremental journey - you won’t get it right first time
- While size is important, number of services is often the limiting factor
[email protected] @samnewman
http://www.flickr.com/photos/janicskovsky/6362911179/ http://www.flickr.com/photos/mayhem/2939259129/ http://www.flickr.com/photos/clover_1/4855455737/ http://www.flickr.com/photos/safari_vacation/6384704645/ http://www.flickr.com/photos/moriza/292125851/ http://www.flickr.com/photos/hoyvinmayvin/4010761680/ http://www.flickr.com/photos/jakescreations/52860690/ http://www.flickr.com/photos/doug88888/5888519573/ http://www.flickr.com/photos/dannykboyd/4746718211/ http://www.flickr.com/photos/anantns/6765139575/ http://www.flickr.com/photos/pen3ya/2011092846/