What is event-driven architecture and how does it relate to serverless?

Answer

Event-driven architecture (EDA) is a design pattern where services communicate by producing and consuming events (immutable records of something that happened) rather than direct API calls. Events are published to an event bus or message queue; consumers react when events arrive. EDA and serverless are natural partners: (1) Serverless functions are inherently event-driven — they exist to handle events (HTTP requests, file uploads, queue messages); (2) Event-driven scaling — serverless scales precisely to the event rate without pre-provisioning; (3) Loose coupling — services don't know about each other, only the event schema; (4) Built-in event sources — AWS EventBridge, SQS, SNS, Kinesis, DynamoDB Streams are all native Lambda triggers; (5) Choreography over orchestration — in EDA, each service reacts to events independently rather than being centrally orchestrated. An order placed in an e-commerce system triggers inventory update, payment processing, and email confirmation simultaneously — each handled by a separate Lambda function subscribing to the "order.placed" event.