25
@farmar #VoxxedVienna SOA Lessons Learnt (or Microservices Done Better) Sean Farmar Particular Software

SOA Lessons Learnt Voxxed Vienna 20170317

Embed Size (px)

Citation preview

Page 1: SOA Lessons Learnt Voxxed Vienna 20170317

@farmar#VoxxedVienna

SOA Lessons Learnt (or Microservices Done Better)

Sean Farmar

Particular Software

Page 2: SOA Lessons Learnt Voxxed Vienna 20170317

2

Tried all “Best Practices”Layers and Tiers

Distributed monoliths using Web Services

and failed ...

@farmar

My journey to SOA

Page 3: SOA Lessons Learnt Voxxed Vienna 20170317

@farmar3

So I went to my master

Page 4: SOA Lessons Learnt Voxxed Vienna 20170317

4

Solve the problem you want?mmmm…

Coupling your problem is…

@farmar

Page 5: SOA Lessons Learnt Voxxed Vienna 20170317

5

Coupling

@farmar

Page 6: SOA Lessons Learnt Voxxed Vienna 20170317

6

Coupling Dimensions

Afferent (Ca)

Efferent (Ce)

What depends on you

What you depend on

@farmar

Page 7: SOA Lessons Learnt Voxxed Vienna 20170317

7

Coupling DimensionsTemporal

Time, synchronous communication, logical temporal

couplingSpatial

Physical, deployment, endpoint address

Platform Protocols, platform specific

features @farmar

Page 8: SOA Lessons Learnt Voxxed Vienna 20170317

8

Fallacies of Distributed Computing

var svc = new MyService();

var result = svc.Process(data);

@farmar

Page 9: SOA Lessons Learnt Voxxed Vienna 20170317

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

Page 10: SOA Lessons Learnt Voxxed Vienna 20170317

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

Page 11: SOA Lessons Learnt Voxxed Vienna 20170317

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

Page 12: SOA Lessons Learnt Voxxed Vienna 20170317

@farmar12

Why Microservices?Break down the monolith

Page 13: SOA Lessons Learnt Voxxed Vienna 20170317

13

Monolith

UI

BL

DAL

DB

Tight CouplingLoose Coupling

@farmar

Page 14: SOA Lessons Learnt Voxxed Vienna 20170317

14

Vertical Slicing

UI

BL

DAL

DB Referential Integrity

Tight CouplingLoose Coupling

Re-introduces Coupling

SalesConte

ntCRMOps

@farmar

Page 15: SOA Lessons Learnt Voxxed Vienna 20170317

15

Why SOA

“Address coupling in our software design by building loosely coupled and highly encapsulated components”

Udi Dahan

@farmar

Page 16: SOA Lessons Learnt Voxxed Vienna 20170317

16

Encapsulation

AutonomyDecomposing business entities

by properties/fieldsBounded context == high coupling

@farmar

Page 17: SOA Lessons Learnt Voxxed Vienna 20170317

17

Design

Don’t generalise, be explicit SRP (Single Responsibility Principle)Keep your vertical slice thin, top to

bottom

@farmar

Page 18: SOA Lessons Learnt Voxxed Vienna 20170317

18

Lessons learnt

It’s hard (er)Asynchronous fire and forget,

Pub/SubSeparating data writes and data

reads (CQS)

@farmar

Page 19: SOA Lessons Learnt Voxxed Vienna 20170317

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

Page 20: SOA Lessons Learnt Voxxed Vienna 20170317

20

Lessons learnt

Data (write) ownershipReferential integrity and GUIDS

Data reads and eventual consistency

@farmar

Page 21: SOA Lessons Learnt Voxxed Vienna 20170317

21

Lessons learnt

Monitoring - Lights onTesting is HARD

Deployment - Automate everything

@farmar

Page 22: SOA Lessons Learnt Voxxed Vienna 20170317

22

Lessons learnt

Organization and people, trustBe pragmatic but keep the paradigm

Build your business not a system

@farmar

Page 23: SOA Lessons Learnt Voxxed Vienna 20170317

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

Page 24: SOA Lessons Learnt Voxxed Vienna 20170317

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

Page 25: SOA Lessons Learnt Voxxed Vienna 20170317

25

Thank You!Sean Farmar

Particular.net

@farmar