[ Presented together with Edson Yanaga at Microservices Day Atlanta, January 23, 2018 https://www.redhat.com/en/events/red-hat-microservices-day-atlanta#event-tab-1 ]
Data Strategies for MicroserviceArchitecturesEdson YanagaDirector of Developer Experience@yanagaMarius BogoeviciChief Architect, Data Streaming@mariusbogoevici
View Slide
Code is easy,state is hard
POJOs as an(Anemic) Domain Model
‘Traditional’ application design
Applying Domain Driven Design
Persistent Data
Strategy: One Database per Microservice
Virtualization: where physical separation is hard
Volatile data: caching and sharing state
Reducing latency via caching
Sharing state - replication and partitioning
Propagating state change:Event Sourcing & CDC
Communication: synchronous/asynchronous1: ship2: update state3: update state update state update stateOrderCreated
Event SourcingOrderCreatedId: 1OrderUpdatedId: 1OrderCreatedId: 2
Change Data Capture
CQS(Command-Query Separation)
“Asking a question should notchange the answer”(Bertrand Meyer)
CQRS(Command QueryResponsibility Segregation)
Join developers.redhat.com19CQRS (Command Query Responsibility Segregation)
Join developers.redhat.com20CQRS with separate data stores
CQRS & Event Sourcing
Why CQRS?
Performance
DistributionAvailabilityIntegrationAnalytics
Join developers.redhat.com25Canonical Source of Information(Write Data Store)
Join developers.redhat.com26Canonical Source of Information(Write Data Store)Read Data Store Read Data Store
Join developers.redhat.com27Canonical Source of Information(Write Data Store)Read Data Store Read Data StoreEvents Events
Different choices oftechnology depending on therequirements
LatencySizeStalenessOwnershipSecurityType?
Join developers.redhat.com30http://infinispan.org/In-memory Data Grids
Join developers.redhat.com31http://teiid.jboss.org/Data Virtualization
Join developers.redhat.com32http://debezium.io/Change Data Capture
Joindevelopers.redhat.comFeedback welcome!@mariusbogoevici@yanaga
plus.google.com/+RedHatlinkedin.com/company/red-hatyoutube.com/user/RedHatVideosfacebook.com/redhatinctwitter.com/RedHatNewsThank you!