Adventureswith micro services
-
Upload
thoughtworks -
Category
Technology
-
view
523 -
download
1
Transcript of Adventureswith micro services
![Page 1: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/1.jpg)
Adventures with
micro-ServicesMohit Thatte (@mohitthatte)
Jesal Mistry (@jesalnmistry)
ThoughtWorks Inc.
![Page 2: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/2.jpg)
What?
Why?
How?
When?
![Page 3: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/3.jpg)
Components
Library Service
![Page 4: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/4.jpg)
What are micro services?
small independent composable
services
that do one thing well
![Page 5: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/5.jpg)
Unix philosophyWrite programs that do one thing well.
Write programs that work together.
cat | grep | sed | awk | ...
HTTP is the new pipe!
![Page 6: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/6.jpg)
lots of legacy, no reuse
not flexible, high cost of change
no one knows how it works
concentrated complexity
independent small that do one thingcomposable
90 year old business
![Page 7: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/7.jpg)
“A 100k loc app is just 100 1k loc appswaiting to happen”
- Jeff Bay
![Page 8: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/8.jpg)
Adventure so far
25 VM’s in production
10+ micro-services
one click deployment
60+ VM’s acrossenvironments
![Page 9: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/9.jpg)
µService
DB
µService
DB
µService
DB
µService
DB
![Page 10: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/10.jpg)
Orders PaymentsCustomersLegacy ResultsOrderProcessing
Catalog(Games)
![Page 11: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/11.jpg)
Thumb Rules
1 top level resource (2 at most)
bounded contexts
focus on contracts
avoid coupling
idempotent jobs
extract cross cutting concerns
![Page 12: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/12.jpg)
Orders PaymentsCustomers
Communications
Legacy ResultsOrderProcessing
ScheduledJobs
Errorreporting
Catalog(Games)
![Page 13: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/13.jpg)
Continuous Delivery
Is my code good to go to production?
Can I deploy it in a single click?
![Page 14: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/14.jpg)
“we’re effectively pushing thecomplexity from the application
into the infrastructure...”
- James Lewis
![Page 15: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/15.jpg)
CI + DevOpsenables
single-click deployment
so easy, our product owner does it!
it just works™
3 mins to production (~25 servers)
![Page 16: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/16.jpg)
Puppet Solo
Provisioning begins at home - Vagrant
Puppet goes through CI just like app code
Our ideal : ImmutableServer
Provisioning
![Page 17: Adventureswith micro services](https://reader033.fdocuments.in/reader033/viewer/2022052618/554f3ff6b4c905471e8b4ccc/html5/thumbnails/17.jpg)
Tradeoffs
benefit cost
small units of reuse/maintenance complex infrastructure
grow independently (**polyglot) network overhead
scale independently fragmented data
“easier” to grok “harder” to grok
isolated boundaries coarse-grained API
logging / tracing