Customer Stories / Media & Entertainment / Global

2023
Amazon Prime Video Logo

Fire TV at Amazon Prime Video Modernizes Its Stack Using Amazon ECS with AWS Fargate

Learn how the Fire TV team at Amazon Prime Video improves engineering productivity and drives innovation by using Amazon ECS with AWS Fargate.

Increased focus on innovation

as engineers are free from capacity management

Automatically scales

up to 6,000 containers during peak events

Faster deployments

due to increased developer velocity

Empowers engineers

to verify code in a production environment within minutes

Overview

Subscription-based streaming service Amazon Prime Video (Prime Video) delivers channels, movies, and television shows to subscribers globally, which they can stream from virtually any device. The Fire TV team at Prime Video, which is responsible for managing the Prime Video app for Fire TV devices, wanted to shift from its shared architecture. This team found its shared architecture hard to scale, and it wanted to build a serverless architecture on Amazon Web Services (AWS) that could scale to millions of active subscribers and simplify deployments and upgrades across devices. Further, the team wanted to free its engineers from the task of provisioning resources manually. 

The Fire TV team at Prime Video decided to adopt a backend-for-front-end architecture and rebuilt a dedicated stack for each of the Fire TV streaming experiences. The Fire TV team at Prime Video implemented Amazon Elastic Container Service (Amazon ECS) to run secure, reliable, scalable, and highly fault-tolerant containers with AWS Fargate, a serverless, pay-as-you-go compute engine for containers. By modernizing its stack, the Fire TV team at Prime Video simplified capacity management and empowered its engineers to focus on improving the viewer experience by accelerating the development of new features and experiences.

Prime Video Image

Opportunity | Using Amazon ECS with AWS Fargate to Accelerate Feature Development for the Fire TV Team at Prime Video

Amazon.com Inc. launched Prime Video as a streaming service in 2011. As Prime Video grew in popularity, its teams built more experiences that would support different device types, with one backend presentation service supporting three client applications—iOS, Android, and Fire TV. This backend also supported all 20 unique digital experiences for Fire TV. 

A separate Prime Video team was responsible for scaling this presentation service using Amazon Elastic Compute Cloud (Amazon EC2), which provides secure and resizable compute capacity for virtually any workload. With this model, a bug on one client application could impact the viewing experience across other device types. To overcome this challenge, the Fire TV team at Prime Video adopted a backend-for-front-end architecture model and set up over 4,000 containers using Amazon ECS with AWS Fargate. “Our code can live in a dedicated backend for each device type that we support,” says Sanket Patel, senior software development manager at Prime Video. “We can make changes to the code very quickly and more simply.” 

The Fire TV team at Prime Video also decided to containerize its workloads and take a serverless-first approach—a decision that would help their engineers focus on feature delivery. “Instead of having engineers managing Amazon EC2 instances, we wanted them to work on features that would impact customers and add value to our business,” says Patel. To meet its performance requirements, the team worked alongside the AWS team to increase the soft quota limits for Amazon ECS.

kr_quotemark

The success of this migration showed that Fargate is a great choice for customer facing Prime Video services, and we’re seeing many other teams choose Fargate for their services."

Hani Suleiman
Senior Principal Engineer, Amazon Prime Video

Solution | Adopting a Serverless Approach to Decouple Code, Automatically Scale, and Innovate More on AWS

The Fire TV team at Prime Video refactored its application code to a cellular architecture using the AWS Cloud Development Kit (AWS CDK), which gave the team the ability to define its cloud application resources using familiar programming languages. By isolating its presentation service into cells, the Fire TV team at Prime Video reduced the impact of code changes across other Prime Video device types and established clear ownership for its presentation stack. As a result, the Fire TV team at Prime Video freed up its engineers from manual, repetitive work, improving their overall satisfaction and giving them more opportunities to innovate.

The Fire TV team at Prime Video also uses AWS CDK to support personal developer stacks with a self-service strategy so that its engineers can focus on developing features that improve the viewing experience and optimize the performance of their code. “Teams can write tests against experimental production deployments,” says Hani Suleiman, senior principal engineer at Prime Video. “Any engineer can deploy compute resources in their own AWS account and replicate that setup to production.” Empowering its engineers in this way makes it possible for the Fire TV team at Prime Video to verify its code in a production environment within minutes.

To automate the scaling of its infrastructure, the Fire TV team at Prime Video implemented Amazon ECS scheduling tasks and capacity management features. If one of the hosts fails, Amazon ECS with AWS Fargate will automatically replace it within 2–3 minutes. During peak events, such as Thursday Night Football, the team has seen its stack scale to up to 6,000 containers automatically. To further enhance scalability, the Fire TV team at Prime Video set up individual cells for each Fire TV experience. For instance, the team has a dedicated backend for Fire TV devices that support touch interactions and remote directional pads. “Our Fire TV experiences have slightly different data requirements,” says Brent Marieb, senior software engineer at Prime Video. “By having a dedicated cell for every experience, we can specify the number of containers that are required for each cell and reduce the scope of impact of code misconfigurations.”

The Fire TV team at Prime Video integrated Amazon ECS with Amazon CloudWatch, which collects and visualizes near-real-time logs, metrics, and event data in automated dashboards to streamline infrastructure and application maintenance. The team monitors all key performance indicators and metrics using Amazon CloudWatch and can troubleshoot bugs and anomalies faster than before with automated alerts. “We can get metrics at subminute granularity,” says Patel. “If a customer reports an issue to us, we can go to our Amazon CloudWatch dashboards and identify the root cause of the issue.”

Architecture Diagram

Prime Video App on FireTV devices

Prime Video App on FireTV devices

Click to enlarge for fullscreen viewing. 

Outcome | Continuing to Adopt Amazon ECS with AWS Fargate across Prime Video Teams

The Fire TV team at Prime Video completed the migration from the previous architecture to Amazon ECS using AWS Fargate in a few months. To further improve the performance of its code, the team is exploring chaos engineering, or purposeful fault injection experiments. Chaos engineering is a resilience solution available in the AWS Solutions Library, a one-stop shop for vetted solutions and guidance for business and technical use cases. “We can simulate security events for our services while they’re in our preproduction environments,” says Patel. “That way, we can proactively find vulnerabilities in our code and fix them.”

Because the Fire TV team at Prime Video has improved engineering efficiency and fault tolerance using Amazon ECS with AWS Fargate, Prime Video has begun recommending that other teams adopt a serverless approach using this setup. “We spin up new services almost weekly,” says Suleiman. “The success of this migration showed that Fargate is a great choice for customer facing Prime Video services, and we’re seeing many other teams choose Fargate for their services.”

About Amazon Prime Video

Launched as a streaming service in 2011, Amazon Prime Video provides its subscribers with access to popular television shows, movies, and premium channels.

AWS Services Used

Amazon ECS

Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service that simplifies your deployment, management, and scaling of containerized applications.

Learn more »

AWS Fargate

AWS Fargate is a serverless, pay-as-you-go compute engine that lets you focus on building applications without managing servers. AWS Fargate is compatible with both Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS).

Learn more »

AWS CDK

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework for defining cloud infrastructure as code with modern programming languages and deploying it through AWS CloudFormation.

Learn more »

Amazon CloudWatch

Amazon CloudWatch collects and visualizes real-time logs, metrics, and event data in automated dashboards to streamline your infrastructure and application maintenance. 

Learn more »

More Media & Entertainment Customer Stories

no items found 

1

Get Started

Organizations of all sizes across all industries are transforming their businesses and delivering on their missions every day using AWS. Contact our experts and start your own AWS journey today.