Microservices all the thing! they say. Nowadays it seems that if architectures are not microservices based they are not worth the name. Is it really true? Do we really need a (micro)services based architecture?
We should design our systems with longevity, manutenability, and evolution simplicity in mind. Not hype. Long living systems are our primary goal. We'll analyze most common errors and we'll see how architecture can be a game changer in systems design.
Join Mauro in a journey that aims to disclose what it means to build a distributed system based on a (micro)services oriented architecture.
27. HTTP all the rage
because it’s the microservices way
mauroservienti
28. Suppliers & Products & Shopping Cart
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
- Inventory
- Name
- Description
Shopping Cart
- Item ID
- Price
- Inventory
Products
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
- Supplier ID
- Item ID
- Purchase Price
Suppliers
Update XYZ Price
Are we selling?
New Purchase Price
mauroservienti
29. “the microservices way”
Shopping CartProducts
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Suppliers Update XYZ Price
Are we selling?
New Purchase Price
• Incoming “external” HTTP Post
• HTTP Query from Suppliers to Products
• HTTP Post from Suppliers to Products
• HTTP Query from Products to Shopping Cart
• HTTP Post from Products to Shopping Cart
mauroservienti
30. The snowball effect
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
- Inventory
- Name
- Description
Shopping Cart
- Item ID
- Price
- Inventory
Products
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
- Supplier ID
- Item ID
- Purchase Price
Suppliers
Update XYZ Price
Are we selling?
New Purchase Price Ooops...
mauroservienti
32. The snowball effect: can we rollback?
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
- Inventory
- Name
- Description
Shopping Cart
- Item ID
- Price
- Inventory
Products
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
- Supplier ID
- Item ID
- Purchase Price
Suppliers
Update XYZ Price
Are we selling?
New Purchase Price Ooops...
mauroservienti
40. Queries are still a thing: Add item to cart.
[ list-of ]
- Item ID
- Price
- Quantity
- Inventory
- Name
- Description
Shopping Cart
- Item ID
- Price
- Inventory
Products
copy price
copy inventory
mauroservienti
41. Data sharing is still a thing
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
- Inventory
- Name
- Description
Shopping Cart
+ new price details
Business
Logic
Sell Price Changed
MovetoSavedfor…
mauroservienti
42. We’re flooding the system…
Shopping CartProducts
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Is item XYZ in a cart?
Swap & Insert Prices
Move to Saved for…
Is item XYZ in a cart?
Update XYZ inventory
Update XYZ Price
Update XYZ Inventory
Over and over, and over, and over…
mauroservienti
44. User mental model is misleading
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
- Inventory
- Name
- Description
Shopping Cart
- Item ID
- Price
- Inventory
Products
- Supplier ID
- Item ID
- Purchase Price
Suppliers
mauroservienti
45. Let’s focus on the Shopping Cart
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
- Inventory
- Name
- Description
- Etc…
Shopping Cart
mauroservienti
46. Sales shopping cart
[ list-of ]
- Item ID
- Quantity
- Inventory
- Name
- Description
- Delivery Est.
Shopping Cart
- Item ID
- Price
Sales
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
mauroservienti
47. - Item ID
- Price
Sales
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
Warehouse shopping cart
[ list-of ]
- Item ID
- Quantity
- Name
- Description
- Delivery Est.
Shopping Cart
[ list-of ]
- Cart ID
- Item ID
- Inventory
- Quantity
Warehouse
- Item ID
- Inventory
mauroservienti
48. Shipping shopping cart
[ list-of ]
- Item ID
- Quantity
- Name
- Description
Shopping Cart
[ list-of ]
- Cart ID
- Item ID
- Quantity
- Delivery Est.
- Item ID
- Price
Sales
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
[ list-of ]
- Cart ID
- Item ID
- Inventory
- Quantity
Warehouse
- Item ID
- Inventory
- Item ID
- Delivery
Type
Shipping
mauroservienti
49. Marketing tends to be stable
[ list-of ]
- Item ID
- Quantity
Shopping Cart
[ list-of ]
- Cart ID
- Item ID
- Quantity
- Delivery Est.
- Item ID
- Price
- Item ID
- Name
- Description
Marketing
Sales
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
[ list-of ]
- Cart ID
- Item ID
- Inventory
- Quantity
Warehouse
- Item ID
- Inventory
- Item ID
- Delivery
Type
Shipping
mauroservienti
50. Do we need the Shopping Cart at all?
[ list-of ]
- Item ID
- Quantity
Shopping Cart
[ list-of ]
- Cart ID
- Item ID
- Quantity
- Delivery Est.
- Item ID
- Price
- Item ID
- Name
- Description
Marketing
Sales
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
[ list-of ]
- Cart ID
- Item ID
- Inventory
- Quantity
Warehouse
- Item ID
- Inventory
- Item ID
- Delivery
Type
Shipping
mauroservienti
51. Can Sales be responsible for that concept?
[ list-of ]
- Cart ID
- Item ID
- Quantity
- Delivery Est.
- Item ID
- Price
- Item ID
- Name
- Description
Marketing
Sales
Cart ID
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
[ list-of ]
- Cart ID
- Item ID
- Inventory
- Quantity
Warehouse
- Item ID
- Inventory
- Item ID
- Delivery
Type
Shipping
mauroservienti
52. We followed the coupling
[ list-of ]
- Cart ID
- Item ID
- Quantity
- Delivery Est.
- Item ID
- Price
- Item ID
- Name
- Description
Marketing
Sales
Cart ID
[ list-of ]
- Item ID
- CurrentPrice
- LastPrice
- Quantity
[ list-of ]
- Cart ID
- Item ID
- Inventory
- Quantity
Warehouse
- Item ID
- Inventory
- Item ID
- Delivery
Type
Shipping
mauroservienti
53. What a (micro)service is
the technical authority
for a specific business
capability
All business rules (& data) reside within the service
mauroservienti
58. Takeaways
• Boundaries are key to success
• Do not bring in more technology to solve non-
technical problems
mauroservienti
59. Takeaways
• Boundaries are key to success
• Mental model can badly influence design
• Users/Business analysts tend to think in term
of data presentation
mauroservienti
60. Takeaways
• Boundaries are key to success
• Mental model can badly influence design
• Do not name things prematurely
• Premature names stick and drive data
aggregation
mauroservienti
61. Takeaways
• Boundaries are key to success
• Mental model can badly influence design
• Do not name things prematurely
• Behaviors define how to aggregate data
• Group data that change together and that influence each
other
• Use anti-requirements techniques to validate data
grouping
• Follow the coupling
mauroservienti
62. Takeaways
• Boundaries are key to success
• Mental model can badly influence design
• Do not name things prematurely
• Behaviors define how to aggregate data
• Use messaging to temporally decouple services
mauroservienti
G’day everyone and welcome to this webinar that is part of Codemotion
Codemotion is the multichannel platform that helps developers in their professional growth
Codemotion is the biggest tech conference for developers in EMEA, open to all languages and technologies.
Codemotion also organizes many events for developers, such as tech meetups, webinars, hackathons, and training courses
these are the upcoming Codemotion conferences.
A few months the Codemotion online platform was launched
Here is a sneak preview of the Codemotion Platform, where you can find articles, videos of events, interviews, and webinars.
Shall we get started?
How is this thing designed?
I’m a remote worker
I enjoy going to work by bike
And I enjoy bananas as lunch breaks
Bike riding and bananas in the backpack are not a great idea, so…
Price cannot unexpectedly change while an item is in the cart
Price cannot unexpectedly change while an item is in the cart
distributed monolith
distributed monolith
distributed monolith
At Cart Item Add time
Deploy time
Again, not technical, but look at it from a business perspective. What is the responsibility of a service?