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, manipulating, 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

Introducing Website Speed Test: An Image Analysis Tool Integrated with WebPagetest

Because images dominate page weight, methodical image optimization can have a significant effect on conversions and user experience. And the performance tools you choose to use can have a powerful impact on how websites are built and maintained. One such popular open source tool is WebPagetest. It is designed to measure and analyze webpage performance, which is why Cloudinary chose to partner with our friends over there to launch Website Speed Test.

Read more

You might have read some tutorials or articles explaining the importance of images and how to optimize them to deliver a great experience to your users. But does this work really translate into wins for your company? In this talk, you see real-world examples of the positive impact that image optimizations can have on metrics that your bosses and clients care about. You will walk away from this talk with compelling data and useful tools to help you get buy-in and support for this important user experience work at your company.

Read more
Don’t let your digital assets become a liability!

Everyone is a content producer today - from the largest publishing house and entertainment studio, down to the smallest ecommerce store, corporate website or personal blog.

If content is the lifeblood of your website or application, images and videos form the heart that makes it tick and creates an emotional connection with the audience. But, using images and videos to make the content visually engaging and meet your conversion goals, you face a new challenge: managing your digital assets. Because the images and videos are created by different teams for different channels - such as website, social media, ecommerce store, blogs, partners and digital agencies to name a few - chaos can ensue.

Read more

Image Optimization in Python

By Prosper Otemuyiwa
Image Optimization in Python

Approximately 62 percent of today’s internet traffic is made up of images. Media-rich websites must ensure that all images are optimized to speed up the site. A faster site will make your visitors happy; and when they are happy you will likely see increased conversion rates.

Read more