a microservices journey - goto conference...easy to extract changing frequently different resource...
TRANSCRIPT
![Page 1: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/1.jpg)
A Microservices JourneySusanne Kaiser
@suksr
CTO at Just Software@JustSocialApps
![Page 2: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/2.jpg)
Each Journey is Different
“People try to copy Netflix, but they can only copy what they see. They copy the results, not the process.”
Adrian Cockcroft, AWS VP Cloud Architect, former Netflix Chief Cloud Architect
![Page 3: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/3.jpg)
Each Journey is Different
Team
Structure Skillset
Size
Journey
Affecting Circumstances
![Page 4: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/4.jpg)
Each Journey is Different
Team
Structure Skillset
Size
Journey
Legacy
Maintenance effort
Runtime environment
Affecting Circumstances
![Page 5: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/5.jpg)
Each Journey is Different
Team
Structure Skillset
Size
Journey
Legacy
Maintenance effort
Runtime environment
Strategy
New Features Timeline / Milestones
Affecting Circumstances
![Page 6: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/6.jpg)
Background
JUST DRIVE JUST CONNECT JUST LIST JUST WIKI
JUST PEOPLE JUST NEWS
JUST SOCIAL
![Page 7: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/7.jpg)
One teamSingle Unit
One collaboration product
One technology stack
At the BeginningA Monolith in Every Aspect
![Page 8: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/8.jpg)
BackgroundAfter an Evolving Time
![Page 9: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/9.jpg)
BackgroundAfter an Evolving Time
Productivity suffered
![Page 10: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/10.jpg)
BackgroundAfter an Evolving Time
Productivity suffered
Usability/UX suffered
![Page 11: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/11.jpg)
BackgroundAfter an Evolving Time
Productivity suffered
Usability/UX suffered
New features released slowly
![Page 12: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/12.jpg)
JUST DRIVE JUST CONNECT JUST LIST JUST WIKI
JUST PEOPLE JUST NEWS
JUST SOCIAL
BackgroundSeparate Collaboration Apps
![Page 13: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/13.jpg)
BackgroundSeparate, Autonomous Teams
Well-defined responsibilites
![Page 14: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/14.jpg)
BackgroundIn The Long Run
Organisation Product Software
![Page 15: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/15.jpg)
BackgroundOur Motivation for Microservices
Autonomous teams
Develop independently Deploy independentlyWork at different partsindependently
Scale independently
At different speed
![Page 16: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/16.jpg)
Identify Bounded ContextsDecomposition Strategy
High cohesion within a service
Loose coupling between services
![Page 17: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/17.jpg)
Identify Bounded ContextsDecomposition Strategy
High cohesion within a service
Loose coupling between services
Bounded Context
Related behaviour
Semantic boundaryaround domain model
Well-defined business function
![Page 18: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/18.jpg)
Identify Bounded ContextsDecomposition Strategy
JUST DRIVE JUST CONNECT JUST LIST
JUST WIKIJUST PEOPLE JUST NEWS
Bounded Contexts
![Page 19: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/19.jpg)
JUST DRIVE
Decomposition StrategyCo-Existing Service From Scratch
![Page 20: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/20.jpg)
JUST DRIVE
Decomposition StrategyCo-Existing Service From Scratch
JUST PEOPLE
![Page 21: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/21.jpg)
Decomposition StrategyCo-Existing Service From Scratch
owns documentstate
REST API
Application-Service
Domain-Model
DB AdapterMonolith
JUST DRIVE
![Page 22: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/22.jpg)
Decomposition StrategyCo-Existing Service From Scratch
owns documentstate
owns profilestate
documentcreated by author
Monolith
REST API
Application-Service
Domain-Model
DB Adapter
![Page 23: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/23.jpg)
owns documentstate
owns profilestate Events
local copyof author
Message Broker
Decomposition StrategyCo-Existing Service From Scratch
REST API
Application-Service
Domain-Model
DB Adapter
Message BrokerAdapter
Monolithpublish
subscribe
![Page 24: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/24.jpg)
DB Adapter
Message Broker Adapter
Application-Service
Domain-Model
REST API
Domain-Event
Good approach in general,
but we did too many steps at once
New UI
New Business Logic
New Data Structure
=> Not optimal to start with
vs.
Decomposition StrategyCo-Existing Service From Scratch
![Page 25: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/25.jpg)
Incremental Top Down
Extracting Web App
Decomposition Strategy
Monolith
REST API
REST API
REST Client
![Page 26: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/26.jpg)
Monolith
REST API
Extracting Business Logic
Application-Service
Domain-Model
DB Adapter
REST Client
Incremental Top DownDecomposition Strategy
Monolith usesextracted business logic
![Page 27: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/27.jpg)
Monolith
Splitting Data Storage
Incremental Top DownDecomposition Strategy
REST API
Application-Service
Domain-Model
DB Adapter
Events
Message Broker
Message BrokerAdapter
publishsubscribe
![Page 28: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/28.jpg)
Which One First?
vs.
Easy to Extract
Changing Frequently
Different Resource ConsumptionEarly experiences w/ Microservices
Greatest benefit after extraction
Decomposition Strategy
![Page 29: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/29.jpg)
Cross-Cutting ConcernsAuthorization
JUST DRIVE JUST WIKI
Fine-grained authorization
Inter-service dependency
![Page 30: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/30.jpg)
Cross-Cutting Concerns
I have a new service that needs authorization. Where isthe authz service I could use?
Not there, yet. Sorry!
Ok, then I am putting my codeto the place where authz handling exists … to the monolith.
Feeding the monolith Re-implementing authz w/ everynew service
Ok, then I am implementing authzin my local service.
Authorization
![Page 31: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/31.jpg)
Cross-Cutting ConcernsHandle Them Early
Feeding the monolith
Re-implementing authz w/ everynew service
Handle Cross-Cutting Concerns Early
![Page 32: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/32.jpg)
Cross-Cutting ConcernsAvoid A Distributed Monolith
Authz Service
![Page 33: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/33.jpg)
Cross-Cutting ConcernsAvoid A Distributed Monolith
Authz Servicetranslate
One stable common contract
translate
translate
![Page 34: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/34.jpg)
Service InteractionEvent-Driven / Request-Driven
command
query EventsMessage Broker
publish subscribe
command
query
Request-Driven Hybrid
EventsMessage Broker
publish subscribe
Event-Driven
![Page 35: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/35.jpg)
How To Manage Shared Data?Hybrid Model
Message Broker
REST API
Remote query directly to source
Events for notification
![Page 36: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/36.jpg)
Event Driven State Transfer
Message Broker
Local copy of profile data
ProfileUpdatedEvent
How To Manage Shared Data?
Events for data duplication
![Page 37: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/37.jpg)
Source Of TruthHow To Manage Shared Data?
Internal source of truth
External source of truth
Multiple sources of truth Single source of truth
Events as first-class citizens
“Traditional” Event-Driven System Event Store
Event Log
![Page 38: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/38.jpg)
Messaging System Storage System Streaming Platform
Message Broker
Event Log Event Stream
![Page 39: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/39.jpg)
How To Manage Shared Data?Kafka Streams
Unbounded, ordered sequenceof data records
Key-value pairContinuouslyupdating
![Page 40: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/40.jpg)
How To Manage Shared Data?Kafka Streams
Kafka TopicLightweight embedded state store (disk-backed)
Service Running in the same processof Microservice
Loaded on startup of Microservice
Streams make data available wherever it’s needed
![Page 41: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/41.jpg)
How To Manage Shared Data?Kafka Streams
Kafka Streams API
join
filter
group by
aggregate
etc.
Changelog of state changesKStream KTable
Snapshot of the latest value for each key
Kafka Stream-Table Duality
(key1, value1), (key2, value2), (key 1, value 3) key1 value3→
key2 value2→
![Page 42: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/42.jpg)
How To Manage Data?Materialized Views w/ Kafka Streams
KafkaTable for enrichment
Document Service
Stream REST API
Materialized View as State Store
Stream-Table-Join
![Page 43: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/43.jpg)
How To Manage Shared Data?Event Streams as a Shared Source of Truth
Events for notification Events for data duplication
● Simple integration● Remote query => increasing coupling
● Eliminating remote query => better decoupling
● Local copy => better autonomy● Duplicating effort to maintain
local dataset
● Simple integration● Remote query => increasing coupling
Event streams as a shared source of truth
● Eliminating local copy => reduces duplicating effort
● Pushes data to where it’s needed● Increases pluggability● Low barrier to entry for new
service
![Page 44: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/44.jpg)
Start small One manageable step at a time
Lessons Learned
Handle cross-cutting concerns early
Avoid a distributed monolith Be aware of affecting circumstances&
Each journey is different :)
Design event-driven & consider event streams as shared source of truth
![Page 45: A Microservices Journey - GOTO Conference...Easy to Extract Changing Frequently Different Resource Consumption Early experiences w/ Microservices Greatest benefit after extraction](https://reader034.vdocuments.us/reader034/viewer/2022042223/5ec98827cd21621731505a6d/html5/thumbnails/45.jpg)
Susanne Kaiser@suksr
CTO at Just Software@JustSocialApps