Counting Clicks Safely: Idempotency, DLQ, and Partial Batch Failure
Turn the logging consumer from the previous article into a real aggregator. Insert SQS between EventBridge and Lambda for batching, retry, and a dead-letter queue, count clicks into DynamoDB with a transaction that both increments counters and prevents double-counting in one atomic operation, and report failures per message so only the broken one is retried. Real tests: a duplicate event counts once, a failing event lands in the DLQ.