Abstracting the Back-end with FaaS

Abstractions are the fundamental building blocks of computing. If I need to build a web application, I don’t write machine code or build TCP packets. I use higher level languages like C or Javascript to send and receive HTTP messages.

Public cloud vendors are in the business of providing abstractions. Functions as a Service (FaaS) are one of the newer services offered by Cloud vendors. Developers are using FaaS to implement back-end logic without configuring a single server. This has sparked a lot of interest in Serverless Architectures. The question I want to ask, is FaaS the ultimate abstraction of Back-end logic.

Is FaaS the ultimate abstraction of Back-end logic?

Public cloud vendors offer services that provide various levels of abstraction over machines. Each service outsources a different level of responsibility to the vendor. Developers can choose to deploy code to:

  • Infrastructure as a Service (IaaS) — Amazon EC2, Azure VMs, ect.

  • Containers as a Service (Caas) — Docker Cloud, Amazon ECS ect.

  • Platform as a Service (Paas) — Heroku, Amazon Elastic Beanstalk, ect.

  • Function as a Service (Faas) — AWS Lambda, Google Cloud Functions ect.

Each services provides a different level of abstraction and unit of scale.

Each layer in the stack is narrower than layer beneath it. A data centre can run many VM’s and an Application contains many Functions. Prior to FaaS, the Application was the smallest unit of scale. PaaS providers would allow developers to scale their applications by deploying multiple instances of their Application. With the introduction of FaaS, developers can break their application down into functions and scale each function independently.

There is nothing smaller than a function. A function takes a set of inputs and may return a set of outputs. We can also abstract a complex series of functions into simpler functions. We cannot break a function down into a smaller unit of scale. Does this mean FaaS is the ultimate abstraction of back-end logic?

What about SaaS or BaaS?

Cloud vendors also provide fully managed Software as a Service (SaaS) or Back-ends as a Service (BaaS). Each of these services are fully managed by a vendor and paid for on a subscription basis. Examples of BaaS services include:

  • Firebase provides a cloud hosted NoSql database

  • Auth0 provides user authentication as a service

  • Amazon SQS provides a durable message queue as a service.

These services provide the ultimate level of abstraction for the service they provide. However, developers do not execute back-end code using these services. For many of these services, all the custom logic is built into the client side. For some of these services, developers can use FaaS to respond to events generated by the service. While these services do provide back-end services, they do not provide back-end logic.

What about Zapier or IFTTT?

Zapier and If this then that (IFTTT) are SaaS products that allow users to build event driven workflows. These services provide a pre-defined set of events and actions. Users can create custom logic by triggering actions on events. Zapier and IFTTT are consumer products and are not designed to be an application back-end. However, the pre-defined actions are an interesting abstraction over custom functions.

Wrapping Up

Functions are the highest level of abstraction right now, but they might not always be. FaaS and Serverless Architectures are still a relatively new concept for many developers. As the platforms mature and adoption increases, developers will create open source functions that other developers will be able to drop into their applications. These pre-built functions will use existing FaaS services and abstract the code from developers. We may even see a Zapier or IFTTT that is designed to connect SaaS or BaaS services.

What do you think? Is FaaS the ultimate abstraction or not?

If you want to see more articles like this, follow me on Medium or Twitter.