Igor Sokolov's Blog

IT blog

Serverless architecture - what is that?

Posted at — Dec 26, 2017

Definition

For sure, a term ‘Serverless’ is a quite hot topic nowadays and as usually for trends, there is no ultimate clear view of what it means. My modest attempt to provide the definition for a concept of Serverless architecture is presented below.

Serverless architecture is an architectural approach (or style) of building an application without the usual server processes, but instead solely on a combination of third-party cloud-based Services, client-side logic, and on custom code that’s run in ephemeral containers (Function as a Service or “FaaS”). 1

The core problem Serverless architecture tries to solve

The main problem is cost and effort:

Prerequisites for the Serverless emergence

Based on my vision following we can highlight following prerequisites of the emergence:

  1. JavaScript and browser capabilities put to life an idea of single-page application using no external software platform. This gave us rich browser-based clients with business logic running locally.
  2. A wide use of RESTful web services and stateless approach. REST paradigm as a simplified version of traditional SOAP web services gave a boost to a number of services available and provided through the Internet.
  3. Significant evolution and a new level and variety of cloud-based services provided ability to fully replace a big chunk of traditional functionality like authentication/authorization (Auth0) or even DB (Firebase real time DB or Amazon DynamoDB)
  4. Emergence of a new _aaS concept. This time, it was a continuation of containerization and cloud computing: Function as a Service (FaaS) which is about running back end code without managing your own server systems or your own server applications. The most well known FaaS platform is AWS Lambda

Major elements of Serverless architecture

An author of the book Serverless Architectures on AWS: With Examples Using AWS Lambda proposes five principles of serverless architectures:

Similarities with other architecture styles

Service-oriented architecture (SOA): Idea of autonomous functions in Serverless is similar to the core concept of autonomous services in SOA. Other crucial ideas of SOA found their place in Serverless: service reusability and autonomy, composability, granularity.

Microservices: Serverless architecture embodies many principles from microservices too. For example, every compute function could be considered to be its own standalone service. Ideally, microservices should be easy to replace, with each service eventually written in an appropriate framework and language. This fully is supported in FaaS where you can easily replace one function with another one even it could be written in a different language.

Containers as a service (CaaS) CaaS is considered usually a special version of Platform as a Service (PaaS) which provides containerization capabilities in cloud. Clients are also capable to deploy their code (containers) without worry about required resource provisioning and necessary scaling. However Serverless/FaaS provides scaling capabilities which is measured milliseconds to start instead of minutes for CaaS.

Known use cases

  1. Application back end - the back-end is build using solely BaaS or FaaS, or even mixture of them. Success examples are:
    • An online education platform A Cloud Guru2
    • A search platform for commercial property Commercial Search3
    • A platform to create tour books for property X Spaceful (before called Property Tour Pro) 3
    • A platform to add personalization capabilities to web sites Unless4
  2. Data processing and manipulation - all logic is presented in FaaS functions and they are invoked by events or on chunks of a data stream. An success example:
    • Real-time Data Processing using AWS Lambda on Thomson Reuters5
  3. Infrastructure automation - because FaaS functions may be invoked in reaction to an event in infrastructure they could be used to perform actions there. For example in the course on CloudAcademy there was presented an approach how to achieve multi-site, multi-master for Amazon DynamoDB using AWS Lambda.

Pros

Cons

Major risks and pitfalls


  1. A great article on Matin Fauler’s blog. There is also available a concise summary. ↩︎

  2. See details about their architecture in the blog post ↩︎

  3. See details about their architecture in the presentation ↩︎

  4. See details about their architecture in the blog post ↩︎

  5. See details about their architecture in the presentation, starting from the slide #25 ↩︎

comments powered by Disqus