A Path To Event Sourcing With Amazon MSK - James Ousby
A Path To Event Sourcing With Amazon MSK - James Ousby
A Path To Event Sourcing With Amazon MSK - James Ousby
Amazon MSK
James Ousby
Senior Solutions Architect
Amazon Web Services
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s build a bank
Learning objectives
• Understand the what and why of event sourcing and how Amazon
Managed Streaming for Apache Kafka (MSK) can help
• Think differently about how you capture, store, and process your data
• Explore the design and build process behind an event sourcing demo
built around MSK
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is event sourcing?
What it is not – persist entities by updating in place
• Domain-driven design
Amazon Aurora
Amazon MSK
Amazon DynamoDB
Amazon Elasticsearch
Service
Future-proofing your data architecture
Amazon MSK
Amazon DynamoDB
prioritize read/write
performance Process
Client
application AWS Fargate
• Compute components can Read
be scaled independently
0 1 2 3 4 5 6 7 8 9
Amazon MSK
Amazon DynamoDB
Migrate and run your Manages provisioning, Multi-AZ replication Multiple levels of
existing Apache Kafka configuration, and within an security for your
applications on AWS maintenance of AWS Region Apache Kafka clusters
without code changes Apache Kafka clusters
Health monitoring
Amazon MSK deployment architecture
Customer VPC Amazon MSK VPC (AWS-managed)
Consumers
Zookeeper Nodes
Management
(e.g., create topic)
Open monitoring with Prometheus
Getting started with Amazon MSK is easy
• Cluster autoscaling
• Schema registry
• Storage tiering
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Our banking app
Design process
1. Model your domain as
Terminology commands, events, aggregates,
and views
• Command
2. Design the command handlers
• Event
• Aggregate 3. Design the event processor(s)
that create your projection
• Projection/
materialized view 4. Design the read side
Simple Machines
Simple Machines is a leading Australian technology
consultancy at the intersection of data architecture,
data engineering, and enterprise software delivery.
The company specializes in engineering real-time,
data-driven platforms and applications.
Simple Machines – experimenting
Simple Sourcing – event source data abstraction built to
use Apache Kafka as primary data store
https://simplesource.io/
Demo architecture
Write
Client
application AWS Fargate
Read
Events
Commands
Client
application
Demo architecture Command handlers
Events
Commands
Events
Event handlers
Client
Application AWS Fargate
Projection
Amazon Elasticsearch
Service
Demo architecture Command handlers
Events
Commands
Events
Event handlers
Client
application AWS Fargate
Read
view
AWS Fargate Amazon Elasticsearch
Service
Read handler
< time for some code />
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Learning objectives
• Understand the what and why of event sourcing and how Amazon
Managed Streaming for Apache Kafka (Amazon MSK) can help
• Think differently about how you capture, store, and process your data
• Explore the design and build process behind an event sourcing demo
built around MSK
Thank you!
James Ousby
joousby@amazon.com
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.