Skip to main content

The execution flow for image and video resizing

In basic form, the way image and video resizing is implemented involves using 'serverless' cloud functions. This doesn't mean an eldritch horror creature performs them, but simply that you don't have a dedicated server waiting to run them; you request to run your function on demand, and then the service provider allocates a server to run it.

Reasons you don't want to be resizing media on your webservers

CPU Load

There are three reasons this is critical:

  1. Webservers are poorly suited to handle heavy processing tasks. They are there to serve web traffic, not perform image transformations - handling image resizing there will slow a website down very quickly.

  2. Available code libraries and performance

    Webservers often do not have efficient libraries for processingprocessing, resizing and re-encoding media inefficiently thisor way.quickly. A common example of an image manipulation library on webservers is Imagick, which is not regarded as particularly efficient.

  3. Concurrency and scaling

    Using cloud functions allows for performing many image resizes concurrently, reducing the time needed to perform many resizes of one image. You can't really do this with webservers, and certainly not in a way that won't impact performance.

Thus, the

The basic execution flow

for an artwork upload would look like this.

<diagram here>