Cloud

Microservices versus monolithic applications: Prime Video chooses the latter

Microservices versus monolithic applications: Prime Video chooses the latter

And’monolithic application (monolith) is a software entity built as a single unit, where all functionality is integrated within a single process or executable. The application consists of a single large block of code that manages all the functions: basically, therefore, it is complex (and expensive) to separate and scale the different parts of the application.

To overcome these problems, developers tend to embrace architectures designed for modular applications e distributedsuch as microservices that allow you to separate the different functionalities of the application into self-contained modules, which themselves are independently scalable and updatable.

I microservizi allow you to scale only the parts of the application that need the most resources, instead of having to scale the entire monolithic application, can be divided into self-contained modules simplifying management and maintenance of the application, allow you to create and deploy new features faster, they help isolate any errors and limit their impact on the entire system.

The team of Prime Video, Amazon’s video streaming service, explained that it has completely redesigned the software solution that checks for problems during the playback of multimedia streams, moving from microservices to a monolithic approach. A choice that may appear unusual but Marcin KolnyPrime Video’s senior software engineer, explains in detail why.

Kolny says that Prime Video uses a system that allows automatic identification of quality problems in audio-video playback (stream corruption, video synchronization problems with the sound track, etc.). The solution previously adopted on Prime Video relied on microservices responsible for carrying out the various phases of the streaming analysis process; these microservices were implemented on top of the stack of theserverless infrastructure Usata da Amazon.

Microservices split audio/video streams into frame video or decrypted audio buffers while special algorithms machine learning they processed the collected material by detecting any defects in the reproduction phase.

For the main part of the procedure, the AWS Step Functions that is, the orchestration service serverless of workflows offered by Amazon itself (with the Step Functions, developers can easily create step workflows, or specify a series of steps to be performed to complete an activity or a complex business process).

In this specific case, the Step Functions were used to coordinate the execution of different functions AWS Lambdaprocessing service serverless that allows you to run code without having to set up, manage, or scale a server infrastructure.

All audio/video data, including elements used for intermediate processing, was stored within bucket AWS S3.

After using the solution for a while, Prime Video engineers started experiencing issues as the architecture has proven to support only about 5% of the load expected. In addition, a high cost operational due to the high volume of read/write activity in the S3 bucket and the large number of transactions prepared by the Step Functions.

Kolny’s team then decided to shift the workload to computing services AWS EC2 ed ECS moving to a monolithic approach and achieving a 90% reduction in operating costs.

Many have seen in the post signed by Kolny a real own goal by Amazon that renounces a distributed architecture to return to a more traditional solution monolith. This is not exactly the case because the characteristics of a service like Prime Video must be carefully weighed.

Undoubtedly, the costs to be faced for move the data are often underestimated when it comes to microservices: this is a fact that Kolny himself admits in his analysis. Embracing a monolithic architecture is not synonymous with spaghetti code (this term describes source code that is extremely complex, confusing, and difficult to read and understand): The good developer will write modular code regardless of the deployment model. “Conceptually, the high-level architecture has remained the same. We still have exactly the same components that we had in the initial designIndeed, Kolny clarifies.

So the Prime Video engineer’s intervention doesn’t pit microservices against the approach monolith: it is about using the right tool for the specific job to be completed: “microservices and serverless components are tools that work at scale, but whether to use them instead of a monolithic application must be evaluated on a case-by-case basis“.

Kolny concludes by explaining that some decisions made by his team are far from obvious but have led to significant improvements. For example, it was possible to replicate a process of media conversion computationally expensive by placing it closer to the software components that act as detectors and parsers stream multimedia.

The applied changes now allow Prime Video to to monitor all the streaming of service users and not just those with the highest number of viewers. This approach results in an even higher quality and an even better customer experience than before.

Leave a Reply

Your email address will not be published. Required fields are marked *