A simple Event-Sourcing Example Using Lambda and DynamoDB [Includes Snapshots]

Written by theburningmonk | Published 2019/08/23
Tech Story Tags: aws | aws-lambda | serverless | event-sourcing | design-patterns | dynamodb | cloud | latest-tech-stories

TLDR An event-sourced system uses snapshots of the current state of an account. The most recent snapshot is Version 22, with a Balance of 60. There have been 3 events since then. There are one snapshot for every 10 rows in the table, to be precise. These snapshots allow me to limit the number of rows I need to fetch on every request. In this case, I have a constant cost of fetching 10 items every time. It means I have to build up the current balance of the account from these events. To rebuild it, I find the most recent snapshots and apply the events since the snapshot was taken.via the TL;DR App

no story

Written by theburningmonk | AWS Serverless Hero. Independent Consultant. Developer Advocate at Lumigo.
Published by HackerNoon on 2019/08/23