microservices done right or soa lessons learnt - sean farmar - codemotion milan 2016
TRANSCRIPT
My journey to SOATried all “Best Practices”Layers and TiersDistributed monoliths using Web Services … and failed
Temporal (time, synchronous communication)Spatial (physical, deployment, endpoint address)Platform (protocols, .Net Remoting)
Coupling Dimensions
Fallacies of Distributed Computing1. The network is reliable. (Bill Joy and Tom Lyon)
2. Latency is zero. (Bill Joy and Tom Lyon)
3. Bandwidth is infinite. (Bill Joy and Tom Lyon)
4. The network is secure. (Bill Joy and Tom Lyon)
5. Topology doesn’t change. (Peter Deutsch)
6. There is one administrator. (Peter Deutsch)
7. Transport cost is zero. (Peter Deutsch)
8. The network is homogeneous. (James Gosling)
The Fallacies EBook
•Go to: http://go.particular.net/codem16
•Ted Neward’s blog: http://blogs.tedneward.com/post/enterprise-computing-fallacies/
Why SOA / Microservices?
“Address coupling in our software design by building loosely coupled and highly encapsulated components”
Udi Dahan
EncapsulationAutonomyDecomposing business entitiesSRP (Single Responsibility Principle)Be explicit Keep your vertical slice thin, top to bottom
Vertical Slicing
UI
BL
DAL
DB Referential Integrity
Tight CouplingLoose Coupling
Re-introduces Coupling
SalesConte
ntCRMOps
Lessons learntIt’s hard (er)Messaging: Asynchronous fire and forget, Pub/SubCQ(R)S: Separating data writes and data readsUse messaging only if it suites
Lessons learnt (cont.)
Decomposing your business domain is hard, no framework/tools will magically fix thatData (write) ownershipReferential integrity and GUIDSData reads and eventual consistency
Lessons learnt (cont.)
Monitoring - Lights onTesting is HARDDeployment - Automate everythingOrganization and people, trustBe pragmatic but keep the paradigm
Summary• Avoid all dimensions of coupling• Avoid synchronous communication between
components/microservices, • Don't share data, use view/read models to share
read only data• Decomposing your business domain and entities• You can do it on .Net platform using NServiceBus• Blog post:
http://particular.net/blog/goodbye-microservices-hello-right-sized-services
• Fallacies EBook: http://go.particular.net/codem16