2. Implementing 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.
There are three reasons this is critical:
- 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.
- Webservers often do not have efficient libraries for processing media in this way. A common example of an image manipulation library on webservers is Imagick, which is not regarded as particularly efficient.
- Using cloud functions allows for performing many resizes concurrently, reducing the time needed to perform many resizes of one image.