Is it time for Serverless?

A police car is patrolling a freeway while hundreds of vehicles drive alongside and pass it during their drive on the freeway. The police car has a device that keeps on scanning all the vehicles moving around and ahead of it. It captures the images of all the vehicle registration plates, processes them, and alerts the cop in the police car. This device is continuously performing these activities irrespective of the load encountered by it.

It may look like a scene taken out from a James Bond movie but that is the reality of the AI/ML world today. With the help of the industry 4.0 revolution and IoT devices spreading across all walks of life, AI/ML is getting huge amounts of data and requires a lot of computation power to process all that data. For every license plate captured by the police car, the data is immediately uploaded onto a cloud server where it is processed by a function specialized in image processing followed by another function that performs the background check on the license plate. When all the processing activities are complete, the functions simply shut down without causing any extra consumption of resources or time. When the police car enters a specific section with very few vehicles around it, the functions on the server become almost inactive, and very minimal cloud resources are consumed.

This is the power of the new cloud deployment paradigm, also known as, serverless computing and Function as a Service (FaaS). All major cloud service providers are offering serverless compute engines at a very competitive price. The primary question is not about the service but the usage. What are the use cases where serverless is required and when would it be a burden on the maintenance teams?

The best Use Cases for Serverless computing

While cloud pundits may suggest various usages of serverless computing, it is best suited for discreet activities and jobs that have a low life expectancy, varying frequency, and instant resource spikes. It is not built for session-oriented or stateful data processing. In the world of microservices and cloud, serverless can be seen as a freelancer. It works best like a helper or a utility function that quickly performs a small piece of work and goes its way. We have prepared a list of some of the best use cases for serverless, that are already in use or would be used in near future.

Blockchain processing

The processing logic of a block is specific to a particular implementation of a blockchain. When an enterprise-level blockchain platform is involved, it is best to use FaaS for implementing the processing logic of the blocks. For example, developing solutions for financial transactions within a closed set of traders. Each of the transactions follows the same rules and is independently processed in isolation within a single instance of the serverless function.

Digital Signature compliance

Document processing applications need to apply the digital signature on hundreds of thousands of files. These may be financial statements, utility bills, receipts, contract documents, and more. A serverless function is the best way to keep this non-business concern external to the core business logic of document creation. Depending on the load and velocity of document generation, FaaS can scale up and down.

Random checks for fraudulent transactions

Banking applications keep a tab on the transactions being performed and keep filtering the suspicious transactions for further checks. These checks are auxiliary to the core banking operations and are triggered only when there is a suspicion about a transaction. A FaaS brings in the quick processing capability that can run in isolation and perform the checks on a transaction without impacting the overall performance of the banking application. It is triggered on a need basis and spins down after completing its task.

Chatbots

Most of the user support groups are now making use of automated chatbots to respond to most of the common problems of the users. This concept is being extensively used by the corporate support desks as well as by the customer support and service departments. For every incoming query from the customer, a chatbot is launched within a FaaS or with the help of a FaaS. The lifespan of the FaaS execution is to process the chatbot queries and provide responses within a limited period of time. It is an easy method for the availability and scalability of the chatbot.

Other Use Cases

Several other modern-day use cases can be easily addressed using FaaS. There are two common traits of all of these use cases:

  • Each of the use cases has a trigger component: Their processing logic is triggered based on some event or time.
  • They have a stateless processing logic: They do not require too much contextual data from the trigger point; the logic is separately built within the function and is applied uniformly on the input data.

A list of other use cases that can easily be addressed using FaaS include:

  • Image and content processing for websites
  • File processing for EDI integration points
  • Security scans and alerts for application vulnerability testing
  • DevOps steps execution for performing various workflow steps within a pipeline
  • Batch jobs executions that are triggered by some events or scheduled for a specific time
  • Data ingestion from IoT sensors that are spread across multiple host devices across the globe
  • Data processing within ETL pipelines that need to perform tokenization, cleansing, and other standard steps

Conclusions

When processing a large amount of data or requests, the cost of operating a VM is still high when compared to a single function. However, it is important to note that a microservice or an application takes care of end-to-end business logic, whereas a function performs a very specific and standard functionality that is not altered due to the context or state of the data.

All major cloud service providers offer one or serverless options that can really boost the cost and resource optimization of any solution. To name a few, these services are AWS Lambda, AWS Fargate, Azure Functions, Azure App Service, Google Cloud Run, Google Functions, Google App Engine, and many more.

Share with:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.