microservices 5 things i wish i'd known
TRANSCRIPT
![Page 1: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/1.jpg)
VINCENT KOK • DEV MANAGER • ATLASSIAN • @VINCENTKOK
Microservices5 things I wish I’d known
![Page 2: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/2.jpg)
B U I L D I N G M I C R O S E RV I C E S
I S S U E S
M O V I N G F O RWA R D
Agenda
![Page 3: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/3.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/fSopv4
You’ve got issues
![Page 4: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/4.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/7WcQwA
Slow down
![Page 5: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/5.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/bRgBZP
Lock up
![Page 6: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/6.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/bByin8
Technology will age
![Page 7: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/7.jpg)
The promise of Microservices
Small Independent lifecycle ReplaceableRight tool
![Page 8: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/8.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/aSqP7p
Steep journey ahead
![Page 9: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/9.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/kENTD4
Fast forward to the top
![Page 10: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/10.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/kENTD4
http://images.clipartpanda.com/rainbow-unicorn-cute-tumblr_lj9cy4iZ821qdabzno1_r4_500.png
No silver bullet
![Page 11: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/11.jpg)
Examples
![Page 12: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/12.jpg)
Confluence
Connect
Conversion
Filestore
![Page 13: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/13.jpg)
Identity
6+AvatarLogin
![Page 14: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/14.jpg)
Build
![Page 15: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/15.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
Build a pattern
https://flic.kr/p/8ykpkW
![Page 16: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/16.jpg)
The Twelve Factor App
XI. Logs
One codebase tracked in revision control, many deploys
V. Build, release, runStrictly separate build and run stages
I. Codebase
Treat logs as event streams
![Page 17: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/17.jpg)
Anatomy of a service
![Page 18: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/18.jpg)
Health check
200!200
![Page 19: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/19.jpg)
/healthcheck
{ "avatar": { "details": {}, "isHealthy": true, "metadata": { "hash": "379965ce", "name": "Avatar service", "version": "2.0.8" } }}
![Page 20: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/20.jpg)
/healthcheck/details{ "avatar": { "details": { "avatarRepository": { "isHealthy": true }, "crowd": { "isHealthy": true }, "deadlock": { "isHealthy": true
![Page 21: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/21.jpg)
1 Build1 Repository
For every service
![Page 22: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/22.jpg)
One Bitbucket repository per service
![Page 23: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/23.jpg)
From slow
MTTR
![Page 24: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/24.jpg)
To fast and reliable
A slightly better MTTR
![Page 25: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/25.jpg)
Configure
![Page 26: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/26.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/8prXA6
Prevent different lifecycles
![Page 27: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/27.jpg)
Layered layout
Common configuration per environment
Per serviceCommon configuration per service
Per environment
![Page 28: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/28.jpg)
Simple formatinclude "common.prod.conf"include "service.conf"
http { port = 8080 interface = "127.0.0.1"}
recaptcha.key.site = "....."recaptcha.enable = true
static.asset.base = "...."
![Page 29: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/29.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
No secrets
![Page 30: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/30.jpg)
Deploy
![Page 31: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/31.jpg)
DeployBuild and testCommit to master
Deployment pipeline
Release
![Page 32: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/32.jpg)
Environments
Development Staging Production Disaster Recovery
![Page 33: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/33.jpg)
Build and upload
Deployment projects take
care of the actual deployment
![Page 34: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/34.jpg)
Create release from build
Build release information
![Page 35: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/35.jpg)
Feedback per environment
Versioned release per environment
![Page 36: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/36.jpg)
Test
![Page 37: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/37.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
Isolation
https://flic.kr/p/dxUhia
![Page 38: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/38.jpg)
PDVFunctional testsUnit tests
Test strategy
Contract tests
![Page 39: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/39.jpg)
Functional tests
Stub Service mock
![Page 40: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/40.jpg)
Stub sample
<beans profile="it">
<bean id="myClient" class=“com.mycompany.MyStub”/> </beans>
![Page 41: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/41.jpg)
WireMock sample{ "request": { "url": “/myresource", "method": “POST” "Accept": { "matches": “application/json” } }, "response": { "status": 204 }}
![Page 42: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/42.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
Consumer Driven Contract Testing
https://flic.kr/p/9mjRKW
![Page 43: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/43.jpg)
An example
Service A Service B
REST
Consumer Provider
![Page 44: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/44.jpg)
Consumer expectation
uponReceiving("A request by user id for a user") .matching(path = "/Users/1") .willRespondWith(body = userByIdResponse) .during { providerConfig => Client(providerConfig.url).get("/Users/1)
must beEqualTo(200, Some(userByIdResponse)) }
![Page 45: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/45.jpg)
Consumer side
HTTP request
HTTP responseClient Service Mock PACT
![Page 46: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/46.jpg)
Provider side
HTTP request
HTTP responsePACT PACT runner Provider
![Page 47: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/47.jpg)
PACT Matrix
Consumer master Consumer prod
Provider master Latest compatibleProvider
Compatible
Provider prod Consumer Compatible Already tested
![Page 48: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/48.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
Post Deployment Verification
https://flic.kr/p/6wHFj5
![Page 49: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/49.jpg)
PDV
Development Staging Production Disaster Recovery
![Page 50: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/50.jpg)
Operate
![Page 51: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/51.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
100 lbs
https://flic.kr/p/biy2an
99% of water
dehydrate to 98%
How much do they weigh now?
![Page 52: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/52.jpg)
50lbs
![Page 53: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/53.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
What is the uptime of service that depends on 30 services
with an uptime of 99.99?
https://flic.kr/p/51TYD1
![Page 54: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/54.jpg)
99.99 = 99.7%30
![Page 55: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/55.jpg)
4m23 to
> 2h
![Page 56: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/56.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
Know your system!
https://flic.kr/p/9b24xc
![Page 57: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/57.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
![Page 58: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/58.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
![Page 59: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/59.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
![Page 60: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/60.jpg)
Trace your requests
X-B3-TraceId : 1X-B3-SpanId : 1
X-B3-TraceId : 1X-B3-SpanId : 2X-B3-ParentSpanId : 1
X-B3-TraceId : 1X-B3-SpanId : 3X-B3-ParentSpanId : 2
X-B3-TraceId : 1X-B3-SpanId : 4X-B3-ParentSpanId : 3
![Page 61: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/61.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
![Page 62: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/62.jpg)
Moving forward
![Page 63: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/63.jpg)
5 Things
![Page 64: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/64.jpg)
• Big cool statistic
• 2,569
• Add-Ons in Marketplace
https://flic.kr/p/3Esx3o
More decisions to come
![Page 65: Microservices 5 things i wish i'd known](https://reader033.vdocuments.us/reader033/viewer/2022052705/587a2e3f1a28abbd388b6ae5/html5/thumbnails/65.jpg)
Thank you!
VINCENT KOK • DEV MANAGER • ATLASSIAN • @VINCENTKOK