/1 Why did Amazon Prime Video monitoring move ππ«π¨π¦ π¬ππ«π―ππ«π₯ππ¬π¬ ππ¨ π¦π¨π§π¨π₯π’ππ‘π’π? How can it save 90% cost?
The diagram below shows the architecture comparison before and after the migration.
/2 What is Amazon Prime Video Monitoring Service?
Prime Video service needs to monitor the quality of thousands of live streams. The monitoring tool automatically analyzes the streams in real-time and identifies quality issues like block corruption, video freeze, etc.
/3 here are 3 steps: media converter, defect detector, and real-time notification.
/4
πΉ What is the problem with the old architecture?
The old architecture was based on Amazon Lambda, which was good for building services quickly. However, it was not cost-effective when running the architecture at a high scale. The two most expensive operations are:
/5 1. The orchestration workflow - AWS step functions charge users by state transitions and the orchestration performs multiple state transitions every second.
/6 2. Data passing between distributed components - the intermediate data is stored in Amazon S3 so that the next stage can download. The download can be costly when the volume is high.
/7
πΉ Monolithic architecture saves 90% cost
A monolithic architecture is designed to address thecost issues. There are still 3 components, but the media converter and defect detector are deployed in the same process, saving the cost of passing data over the network.
/8 Surprisingly, this approach to deployment architecture change led to 90% cost savings!
This is an interesting and unique case study because microservices have become a go-to and fashionable choice in the tech industry.
/9 It's good to see that we are having more discussions about evolving the architecture and having more honest discussions about its pros and cons. Decomposing components into distributed microservices comes with a cost.
/10 πΉ What did Amazon leaders say about this?
Amazon CTO Werner Vogels: βBuilding ππ―π¨π₯π―πππ₯π π¬π¨πππ°ππ«π π¬π²π¬πππ¦π¬ is a strategy, not a religion. And revisiting your architectures with an open mind is a must.β
/11 Ex Amazon VP Sustainability Adrian Cockcroft: βThe Prime Video team had followed a path I call πππ«π―ππ«π₯ππ¬π¬ π π’π«π¬πβ¦I donβt advocate πππ«π―ππ«π₯ππ¬π¬ ππ§π₯π²β.
/12
Get a Free System Design PDF (158 pages) by subscribing to our weekly newsletter today: blog.bytebytego.com
πΉ list: keep your Twitter feeds
πΉ stack: support undo/redo of the word editor
πΉ queue: keep printer jobs, or send user actions in-game
πΉ hash table: cashing systems
πΉ Array: math operations
πΉ heap: task scheduling
/2
πΉ tree: keep the HTML document, or for AI decision
πΉ suffix tree: for searching string in a document
πΉ graph: for tracking friendship, or path finding
πΉ r-tree: for finding the nearest neighbor
πΉ vertex buffer: for sending data to GPU for rendering
/3 Which additional data structures have we overlooked?
A comparison of Docker-based and non-Docker-based development is shown below.
/2
With Docker, we can develop, package, and run apps quickly:
πΉ The developers can write code locally and then build a Docker image and push it to a dev environment. In this way, the development work is shared within the team. The tests are run automatically in the dev env.
/3 An image is a read-only template with instructions for creating a Docker container. We use a Dockerfile to define the steps to create the image and run it.
/1 18 Key Design Patterns Every Developer Should Know
/2 Patterns are reusable solutions to common design problems, resulting in a smoother, more efficient development process. They serve as blueprints for building better software structures. These are some of the most popular patterns:
/3 πΉAbstract Factory: Family Creator - Makes groups of related items.
πΉBuilder: Lego Master - Builds objects step by step, keeping creation and appearance separate.
πΉPrototype: Clone Maker - Creates copies of fully prepared examples.