DEV Community

David Kljajo
David Kljajo

Posted on

Core Event-Driven Concepts - project 3

Week 5 β€” Core Event-Driven Concepts

  1. Learn (Day 1–2)

Understand:

πŸ”Ή SQS
Message queue
Stores tasks until processed
One consumer processes message
πŸ”Ή SNS
Pub/sub system
Sends same message to multiple subscribers
πŸ”Ή EventBridge
Smart event router
Filters and routes events based on rules

  1. Extend Your Existing App (Day 2–3)

Start from your Phase 2 API (Orders or Users system).

Modify:

Instead of:
API β†’ DB only
Now:
API β†’ DB + Event Published

Example event:

{
"eventType": "ORDER_CREATED",
"orderId": "123",
"userId": "abc",
"timestamp": "..."
}

  1. Add EventBridge (Day 3–4) Create: EventBridge Event Bus (custom bus) Flow: Order Lambda sends event β†’ EventBridge Rule:

Route based on:

eventType = ORDER_CREATED

  1. Create First Consumer (Day 4–5) Lambda: Email Simulation

Triggered by EventBridge

Does:

Logs email message like:

"Email sent to user for order 123"

πŸ‘‰ This simulates async email system

πŸ“… Week 6 β€” Scale with SQS + SNS

  1. Add SQS for Reliable Processing (Day 1–2) Use case:

Order processing queue

Flow:

EventBridge β†’ SQS Queue β†’ Lambda Consumer

Why:

Ensures no event is lost
Can retry automatically

  1. Add SNS for Fan-out (Day 2–3) Use case:

One event β†’ multiple systems

Flow:

Order Created β†’ SNS Topic
↓ ↓ ↓
Email Analytics Logging

Each Lambda subscribes to SNS topic.

  1. Build 3 Async Consumers (Day 3–4)

Create Lambdas:

πŸ“§ Email Service Lambda
πŸ“Š Analytics Lambda
πŸͺ΅ Logging Lambda

Each one:

Triggered by SNS or SQS
Runs independently

  1. Observability (Day 4–5)

Use:

CloudWatch logs
Event tracing

Check:

Event delivery
Lambda execution logs
Queue processing
🧠 Final Architecture (What you’ve built)

You now have:

πŸš€ Event-driven system:
API creates order
Event published
Multiple services react independently
🧩 Final Outcome Statement

After this phase, you can confidently say:

β€œI design event-driven systems using AWS services like SQS, SNS, and EventBridge to build scalable, decoupled architectures.”

Top comments (0)