TalksAWS re:Invent 2025 - Building event-driven architectures using Amazon ECS with AWS Fargate (CNS307)

AWS re:Invent 2025 - Building event-driven architectures using Amazon ECS with AWS Fargate (CNS307)

Transitioning from Synchronous Microservices to Event-Driven Architectures with Amazon ECS and AWS Fargate

Overview

  • The presentation discusses how to build event-driven architectures (EDAs) using Amazon Elastic Container Service (ECS) with AWS Fargate, a serverless compute option for containers.
  • The speakers, Eric Johnson and Matt Mecky, cover the challenges of synchronous microservices architectures, the benefits of EDAs, and various patterns and techniques for implementing EDA using ECS and Fargate.

Limitations of Synchronous Microservices

  • Synchronous microservices architectures can become tightly coupled and prone to failure, as seen in the example of Sarah's e-commerce system struggling during a Black Friday sale.
  • Issues like throttling, resiliency problems, and tight coupling between producers and consumers can arise in synchronous architectures.

Introducing Event-Driven Architectures (EDAs)

  • EDAs decouple producers and consumers by introducing a message broker or event router in the middle, enabling asynchronous communication.
  • Key benefits of EDAs include scalability, resilience, and agility, as services can be added or modified without impacting the overall system.

Leveraging Amazon ECS and AWS Fargate for EDAs

  • ECS is a powerful container orchestration service that can be used to build event-driven architectures.
  • Fargate, the serverless compute option for ECS, allows you to run containers without managing the underlying infrastructure.
  • ECS provides two main patterns for running containers: standalone tasks and long-running services, each with their own use cases.

Event Routing Options

  • Event Bridge: A serverless event routing service that can process events one-at-a-time and fan them out to multiple targets.
  • Amazon SNS (Simple Notification Service): A pub/sub messaging service that can broadcast events to multiple consumers.
  • Amazon SQS (Simple Queue Service): A message queuing service that provides one-to-one event processing with ordering and retry capabilities.
  • Amazon Kinesis: A streaming service that enables one-to-many event processing with ordering guarantees.

Scaling and Monitoring EDA Workloads on ECS

  • Autoscaling ECS services using predefined metrics like SQS message count.
  • Implementing custom metric-based autoscaling using a combination of metrics like messages per task and processing time.

Event-Based Container Patterns

  1. Fire-and-Forget: Using Event Bridge to trigger a single ECS task for each event.
  2. Step Functions: Leveraging Step Functions' async, sync, and callback patterns to orchestrate ECS tasks.
  3. Step Functions Activities: Using a managed SQS queue and a pool of ECS workers to process high volumes of events across multiple workflows.

Applying EDA Patterns to Modernize a Synchronous Architecture

  • Refactoring the order, payment, loyalty, and customer notification services to use event-driven, asynchronous patterns.
  • Leveraging ECS, Fargate, and the various event routing options to decouple the system and improve scalability and resilience.

Key Takeaways

  • Synchronous microservices architectures are prone to failure under load, highlighting the need for event-driven approaches.
  • ECS and Fargate provide a powerful platform for building scalable, resilient, and agile event-driven architectures.
  • Various event routing options (Event Bridge, SNS, SQS, Kinesis) offer different trade-offs and can be combined to meet diverse architectural requirements.
  • Autoscaling and custom metric-based scaling are crucial for managing the dynamic nature of event-driven workloads.
  • Stepwise migration from synchronous to event-driven patterns can help organizations modernize their systems incrementally.

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.