Go Serverless For Critical Digital Marketing Workloads

Cloud computing

Cloud comptingIntroduction

Over the last decade, cloud computing has enabled businesses to become more agile in solving complex use cases. It is effective in optimizing IT spending, improving productivity, and reducing the burden of managing IT infrastructure. Cloud computing has come of age and moved beyond the traditional Infra as a Service (IaaS) and Platform as a Service (PaaS) to all-out Serverless Services.

Serverless could very well be called “Cloud 2.0,” and it isn’t a buzzword anymore. It is an architecture approach to building and running software services without having to manage the underlying infrastructure albeit on a cloud platform. It enables businesses to seamlessly integrate different operations across services and deploy application code by abstracting the need to understand the underlying hosting environment.

In this article, I will touch on how Serverless can help scale services in a cost-efficient way for digital marketing use cases with short-lived compute spikes, real-time and batch workloads, and analytics services.


Digital Marketing Use Case

Let me start with a short primer on present-day digital marketing. The pandemic has forced businesses to move away from conventional thinking and take a big leap in their digital transformation journey. Specifically, business-to-consumer (B2C) digital marketing has witnessed just as much transformation where consumers have shifted towards engaging with brands on digital platforms and have upped their expectations for brands.

Consumers prefer to engage with brands that connect with them through personalized messages that suit their preferences and behavior patterns. Brands realize that consumers get bombarded with messages that don’t resonate. It doesn’t result in the marketing outcomes that the brands expect. This has forced brands to move to short-form videos and context-relevant catchy message formats. Consumers expect brands to respect their privacy. They expect personalized interaction through loyalty programs and engagement through the right channels where they are most likely to interact with a brand. All this makes it more challenging for brands to tie the customer journey across multiple touchpoints and devices. It needs dynamic attribution models to predict outcomes and accurately compute the brand’s Return on Marketing Investment (ROMI).



The above business case warrants the need for scalable, performant, highly available, on-demand computing services. One that can adapt well to the changing business needs, interoperate with the existing distributed services, cost less, and importantly faster time to market. This makes it an excellent use case for Serverless.

With Serverless, developers start with Function as a Service (FaaS) wherein code modules are packaged as discrete functions. Code modules remain dormant and get executed through asynchronous events that get triggered or through a synchronous invocation by explicitly calling the code module. These functions are primarily self-contained, purpose-built, and short-lived for the duration of the execution. Developers’ interface FaaS functions with backend services for storage, computing, push notifications, queues, etc., This is the other side to Serverless called Backend as a Service (BaaS), which is a set of out-of-the-box services that can be made operational with limited configuration. Below is a simple picture depicting FaaS & BaaS services. There is more to BaaS than what you see in the picture below.

CloudBoth FaaS and BaaS do not require developers to manage and provision the compute resources. They provide the flexible pay-as-you-consume or pay-as-you-run model on a granular basis, thereby reducing the overall run cost. Services get activated and executed only when invoked and hence help better manage the resources and reduce idle capacity. Developers would focus on how the function is invoked, the duration of execution, and the need for concurrent function instances. Also, the ability to throttle if it exceeds the limit, manage service latency on first-time invocation (aka cold start in Serverless parlance), and timeouts.

When it comes to BaaS all major cloud providers have scalable data storage, pipeline & orchestration services, compute services, and analytics services that make it easy to process data at scale. It doesn’t require developers to plan, procure, configure, and scale IaaS infrastructure. Depending on the use cases, there are multiple serverless options readily available that automatically set up and scale resources and enable high-performance workloads on large datasets without the need to manage the traditional data warehouse cluster or analytics engine.

While Serverless architecture is promising, there are a few hurdles to overcome. It requires a fundamental shift in the way code is thought through, packaged, and deployed. It has a learning curve when building complex workflows and interfacing multiple functions. It is easy to run unit tests by invoking the functions directly, but integration tests with end-to-end workflow with multiple FaaS functions is not straightforward. If the use case requires a fast response with latency < 100 ms, the problem of cold-start (latency on first-time invocation) becomes a challenge. Depending on the cloud service providers, Serverless deployment size varies, and the code deploys needs to be more compact and packaged well. Also, automation tooling needs to evolve further.  Frameworks for logging and monitoring, and observability of services need some more thinking.



These hurdles are certainly manageable and most businesses on the public cloud have been experimenting with Serverless or have critical payloads already running on Serverless. The benefits of Serverless outweigh the costs and the overheads that come with the do-it-yourself way of traditional IaaS implementations. Before giving serverless architecture a serious thought, it would be better to evaluate the business use cases and identify whether a serverless architecture makes sense. Also, take a phased approach, move some of your services to Serverless and run the rest on IaaS. Since it is easily extensible, bring in more services to FaaS and BaaS as the architecture evolves.


Author: KumKumRaj Swamynathan, SVP – Product Engineering, Epsilon India