Cloudinary Blog

Image & Video Gone Serverless

Image and Video Management using Serverless Computing

Nowadays, developers everywhere are introduced to an application development trend called serverless computing. The trend isn’t new but rather an evolution culminating from a number of development methodologies, including service-oriented architecture (SOA), distributed cloud computing, Platform-as-a-service (PaaS) and Containers/Microservices. A key defining element of serverless computing is the serverless application’s logic that combines custom-developed code and 3rd-party service functionality. 

In this article, we will focus on a serverless computing architecture for realtime apps. These apps are characterized by devices and services that exchange structured messages carried via realtime data streams. The flow of data is orchestrated via event-driven logic (called blocks) deployed globally in a managed environment (called a Data Stream Network). We will specifically discuss handling of rich media in realtime apps, per the illustration below.

Image Transformations and Data Streams

A Preface to Serverless

The premise for app developers is highly compelling: (1) run your code without worrying about provisioning servers or the hassle of managing runtime environments and (2) pay only for the compute time your app is actually consuming, resulting in efficient utilization and scaling economics.

So, what is the FaaS (function-as-a-service) all about? As the cloud ecosystem continues to mature, it’s become apparent that we need to be able to partition, scale and ensure adequate QoS (quality-of-service) at an individual function level. We need this level of control in order to reduce complexity and improve external integration with distributed functional components and end-user devices within deployed applications. 

Small is beautiful in this paradigm: the FaaS-based apps are easy to design for scale, have no single-point-of-failure, provide a demand-based pricing model, and give developers the ability to monitor performance and availability – easily pinpointing bottlenecks in order to resolve scale-related issues. General-purpose serverless platforms are now offered by the largest software vendors (AWS Lambda, IBM OpenWhisk, Google Cloud Functions, Azure Functions). These platforms are rapidly evolving in tandem with emerging deployment best practices.

 

Realtime Apps

From consumer to enterprise, the majority of apps being developed now entail “live” realtime behavior whereby functionality is invoked in response to events. Such events (or messages) can be produced or consumed by internal or external functions, end-user devices, and infrastructure services. This, in turn, fits neatly with a (data) stream-oriented programming model where structured messages (e.g. in JSON format) are used for dispatching serverless functions.

Serverless Logic and Data Streams

To underscore the uniqueness of this architectural fabric - not only can functions run anywhere, but their deployment is driven by real-time message streams. With this approach, developing custom logic and integrating external service logic can be done within the same framework. Essentially, this means the differences between integration of internal and external functions starts to diminish.

Taken a step further, event-driven realtime logic that consumes message streams, processes message streams and produces message streams, can be created in a popular programming language (e.g. JavaScript). This logic is composable, in that services can dispatch other services; streams can effectively be connected to one another in structured ways (1-to-1, 1-to-many, etc.)

 

Rich Media on Serverless

One of the immediate places where integration of external services becomes handy is in the handling of rich media, in particular image management. The complexities inherent to uploading, storing, transforming, optimizing and delivering images require expertise well beyond the skillset of most app developers. Luckily, image management bodes well with being abstracted to a service accessible via an easy-to-use API within a serverless framework.

Examples of realtime apps built using a serverless architecture, that can make use of rich media, range from simple photo album sharing to contemporary projects such as twitter/chat bots, home automation, industrial security, editorial collaboration and many others. With the recent availability of the Cloudinary Block, creation of such serverless apps is within immediate reach. Take it for a spin. The setup process is straightforward and we can’t wait to see the cool serverless apps you’ll create, contact us today to learn more.

Recent Blog Posts

Our $2B Valuation

By
Blackstone Growth Invests in Cloudinary

When we started our journey in 2012, we were looking to improve our lives as developers by making it easier for us to handle the arduous tasks of handling images and videos in our code. That initial line of developer code has evolved into a full suite of media experience solutions driven by a mission that gradually revealed itself over the course of the past 10 years: help companies unleash the full potential of their media to create the most engaging visual experiences.

Read more
Direct-to-Consumer E-Commerce Requires Compelling Visual Experiences

When brands like you adopt a direct–to-consumer (DTC) e-commerce approach with no involvement of retailers or marketplaces, you gain direct and timely insight into evolving shopping behaviors. Accordingly, you can accommodate shoppers’ preferences by continually adjusting your product offering and interspersing the shopping journey with moments of excitement and intrigue. Opportunities abound for you to cultivate engaging customer relationships.

Read more
Automatically Translating Videos for an International Audience

No matter your business focus—public service, B2B integration, recruitment—multimedia, in particular video, is remarkably effective in communicating with the audience. Before, making video accessible to diverse viewers involved tasks galore, such as eliciting the service of production studios to manually dub, transcribe, and add subtitles. Those operations were costly and slow, especially for globally destined content.

Read more
Cloudinary Helps Minted Manage Its Image-Generation Pipeline at Scale

Shoppers return time and again to Minted’s global online community of independent artists and designers because they know they can count on unique, statement-making products of the highest quality there. Concurrently, the visual imagery on Minted.com must do justice to the designs into which the creators have poured their hearts and souls. For Minted’s VP of Engineering David Lien, “Because we are a premium brand, we need to ensure that every single one of our product images matches the selected configuration exactly. For example, if you pick an 18x24 art print on blue canvas, we will show that exact combination on the hero images in the PDF.”

Read more
Highlights on ImageCon 2021 and a Preview of ImageCon 2022

New year, same trend! Visual media will continue to play a monumental role in driving online conversions. To keep up with visual-experience trends and best practices, Cloudinary holds an annual conference called ImageCon, a one-of-a-kind event that helps attendees create the most engaging visual experiences possible.

Read more