Serverless Event Sourcing in AWS (Lambda, DynamoDB, SQS)

Dom Kriskovic
Feb 6 · 12 min read

About the Project

Why use CQRS/Event Sourcing?

LINK_CREATED
LINK_RATED
LINK_TAGGED
LINK_TITLE_UPDATED
LINK_IMAGE_UPDATED
USER_FOLLOWED
USER_UNFOLLOWED

Architecture Overview

Fig. 1— Architecture overview

Aggregate Boundaries

Fig. 2 — Beenion aggregates

Optimistic Concurrency Control

Fig. 3—Concurrent save operation

Snapshots

DynamoDB Event Store

Consistency

Ordering

Transactions

Fig. 4— DynamoDB Item with a single event
Fig. 5— DynamoDB Item with multiple events

Projections & Process Managers

Fig. 6— message queue (source)

DynamoDB Streams to SQS

SQS to Event handlers

Code Structure

Fig. 7— The image is taken from this repository which presents a “Clear Architecture” concept

Domain Layer

Application Layer

Client Layer

User Interface

Source Code

Need help with your project?

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade