Skip to content

axeldlv/aws-serverless-outbox-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event-Driven Outbox Pattern with AWS, Terraform, and LocalStack

This project demonstrates how to implement the Outbox Pattern to guarantee consistency between database writes and event emissions in a distributed microservices architecture. Leveraging AWS services, Terraform infrastructure-as-code, and LocalStack for local testing, this setup ensures reliable, event-driven communication.

You can check technical blog here : How to Build an Event-Driven Outbox Pattern with AWS, Terraform and LocalStack

Prerequisites

Architecture Overview

  • Two DynamoDB tables:
    • orders — main business data
    • orders.outbox — stores event records with DynamoDB Streams enabled
  • Lambda function triggered by DynamoDB Stream on orders.outbox
  • Lambda publishes events to an SQS FIFO queue

Architecture Diagram

Features

  • Full infrastructure provisioning with Terraform
  • AWS services emulated locally using LocalStack
  • DynamoDB tables with streams for event tracking
  • SQS FIFO queue for reliable message delivery
  • Lambda functions to handle:
    • Writing orders and events (outbox-lambda)
    • Processing outbox events and sending to SQS (sync-event lambda)
  • Robust error handling and retry logic in Lambda functions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published