This article details Amazon Key's migration from a tightly coupled monolithic system to a resilient event-driven architecture using Amazon EventBridge. It highlights the challenges of the legacy system, including service coupling and inconsistent event management, and presents the design of a modern solution focusing on schema governance, client-side validation, and efficient multi-service integration.
Read original on AWS Architecture BlogAmazon Key's journey to an event-driven architecture (EDA) was driven by the critical need to address scalability, reliability, and maintainability issues inherent in their tightly coupled monolithic system. The legacy architecture suffered from complex interdependencies, where an issue in one service could trigger cascading failures across the entire system. This fragility underscored the necessity for a decoupled design capable of handling millions of events with millisecond latency, paving the way for a more robust and extensible platform.
The modernized architecture adopts a single-bus, multi-account pattern utilizing Amazon EventBridge. This design separates concerns by giving service teams autonomy over their application stacks while a central DevOps team manages the shared event infrastructure. This approach ensures clear ownership, centralized governance, simplified operations, enhanced security, and streamlined compliance.
Key Components of the Event-Driven Solution
Beyond EventBridge, Amazon Key developed three custom components to meet specific requirements: a schema repository for centralized event definitions, a client library for type-safe event handling and client-side validation, and an infrastructure library for reusable subscriber integration components.
To address the challenges of loose schemas, a custom schema repository was implemented as the single source of truth for all event definitions. This repository provides capabilities for data governance, quality control, standardized validation, clear ownership boundaries, and comprehensive audit trails. It facilitates self-service schema discovery and automates validation during development, significantly reducing integration issues and improving team velocity.
{ "$schema": "http://json-schema.org/draft-04/schema#", "$id": "/resource/event/schema/EventV1.json", "title": "EventV1", "description": "Schema for a simple event.", "type": "object", "properties": { "id": { "description": "Id of the event.", "type": "string" }, "type": { "description": "Type of the event.", "$ref": "EventType.json" }, "time": { "description": "Time at which the event occurred. It uses ISO 8601 Date Time Format. Reference: https://www.iso.org/iso-8601-date-and-time-format.html", "type": "string", "format": "date-time" }, "publisher": { "description": "Publisher of the event.", "$ref": "../core/Publisher.json" } }, "required": [ "id", "type", "time", "publisher" ] }