Upload
sean-farmar
View
85
Download
0
Embed Size (px)
Citation preview
@farmar#VoxxedVienna
SOA Lessons Learnt (or Microservices Done Better)
Sean Farmar
Particular Software
2
Tried all “Best Practices”Layers and Tiers
Distributed monoliths using Web Services
and failed ...
@farmar
My journey to SOA
@farmar3
So I went to my master
4
Solve the problem you want?mmmm…
Coupling your problem is…
@farmar
5
Coupling
@farmar
6
Coupling Dimensions
Afferent (Ca)
Efferent (Ce)
What depends on you
What you depend on
@farmar
7
Coupling DimensionsTemporal
Time, synchronous communication, logical temporal
couplingSpatial
Physical, deployment, endpoint address
Platform Protocols, platform specific
features @farmar
8
Fallacies of Distributed Computing
var svc = new MyService();
var result = svc.Process(data);
@farmar
9
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)
@farmar
10
Fallacies of Distributed Computing5. 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)
@farmar
11
Fallacies of Distributed Computing
Fallacies ebook(David Boike): http://go.particular.net/voxxedv17
Ted Neward’s blog: http://blogs.tedneward.com/post/enterprise-computing-fallacies
/
@farmar
@farmar12
Why Microservices?Break down the monolith
13
Monolith
UI
BL
DAL
DB
Tight CouplingLoose Coupling
@farmar
14
Vertical Slicing
UI
BL
DAL
DB Referential Integrity
Tight CouplingLoose Coupling
Re-introduces Coupling
SalesConte
ntCRMOps
@farmar
15
Why SOA
“Address coupling in our software design by building loosely coupled and highly encapsulated components”
Udi Dahan
@farmar
16
Encapsulation
AutonomyDecomposing business entities
by properties/fieldsBounded context == high coupling
@farmar
17
Design
Don’t generalise, be explicit SRP (Single Responsibility Principle)Keep your vertical slice thin, top to
bottom
@farmar
18
Lessons learnt
It’s hard (er)Asynchronous fire and forget,
Pub/SubSeparating data writes and data
reads (CQS)
@farmar
19
Lessons learnt
No silver bullet: use messaging only if it suites
Decomposing your business domain is hard, no framework/tools will
magically fix that
@farmar
20
Lessons learnt
Data (write) ownershipReferential integrity and GUIDS
Data reads and eventual consistency
@farmar
21
Lessons learnt
Monitoring - Lights onTesting is HARD
Deployment - Automate everything
@farmar
22
Lessons learnt
Organization and people, trustBe pragmatic but keep the paradigm
Build your business not a system
@farmar
23
SummaryAvoid all dimensions of coupling
Avoid synchronous communication between components/microservices,
Don't share data, use view/read models to share read only data
You can do it on .Net platform using NServiceBus
@farmar
24
Q&ABlog post:
http://particular.net/blog/goodbye-microservices-hello-right-sized-services
Fallacies EBook: http://go.particular.net/voxxedv17
NServiceBus:http://particular.net
@farmar
25
Thank You!Sean Farmar
Particular.net
@farmar