Serverless Services- uses and advantages

Date

The three big public cloud providers are all offering serverless services (AWS Lambda, Google Cloud Functions and Azure Functions). Obviously, the name is equally misleading as the term “cloud” itself – cloud services are run from within a data centre, serverless services run on compute infrastructure.
What then are the advantages of serverless computing (and after virtualisation, containers and now serverless will there be any smaller unit)?

The main advantages of serverless computing are

  • Low cost (per execution)
  • Quick release / deployment time
  • No server-related tasks
  • Automatic scaling
  • The aim of serverless computing is to run a “function” only when required. I.e. instead of consuming compute resources 24*7 (as in a local data centre), functions are only called, when required, perform their designated task and are terminated. The term “event-driven architecture” is frequently used in the context of serverless computing.

    Care needs to be taken, when using functions to ensure these points are taken into consideration:

  • Architected securely, i.e. dependencies are known and defined and vulnerabilities are managed. Likewise access to the platform must be secure, e.g. including two-factor authentication.
  • Costs are controlled. As functions are on a “pay per use” they should be executed infrequently – calling the same function millions of times per day makes it more suitable to be run within a server environment, as costs are small per execution, but can quickly add up; this is not different to the VM sprawl experienced with server environments, i.e. there is a risk of “function sprawl”.
  • Stateful vs. stateless: typically, functions are stateless, i.e. outputs are generated based on the input. There is a fine line from there to “microservices”, which can be stateful.
  • Portability: How easily can functions be transferred between one cloud provider and another, i.e. there is a risk of lock-in with functions.
  • Latency requirements
  • To complicate matters further, there are open source technologies that allow to build serverless frameworks. These can run in a public or private cloud environment.

    Common use cases are in the areas of:

  • Mobile backend
  • Input from IoT sensors
  • Change data capture / database updates
  • Scheduling of batch jobs
  • Chatbots
  • CI pipelines
  • REST APIs and web apps
  • Like with all technologies there is not a “one size fits all”. Servers, virtual machines, containers and functions have all their own advantages and disadvantages. These need to be evaluated and assessed; once implemented, they need to be controlled and managed.

    More information on Myths of Serverless Computing

    More
    ARTICLES