THE SERVERLESS SERIES — What Is Serverless?

What’s The Difference Between IaaS, SaaS, PaaS, BaaS, FaaS, and Serverless?

Nicolas Dao
Neap For Startups

--

Is Serverless the same as BaaS or FaaS? What’s the difference with SaaS? How did we get there and where are we going next? How can it benefit you? In this post, we will attempt to answer all those questions briefly.

Other topics that will be discussed later in this series will cover subjects such as:

What’s The Difference Between IaaS, SaaS, PaaS, BaaS, FaaS, and Serverless?

Most of the clients of our tech consultancy in Sydney often ask us to clarify what Cloud technologies we will use to engineer their product. The less technical ones are usually confused between the Cloud and SaaS, whereas more tech-savvy founders begin asking about the potential for Serverless architecture but are still confused between FaaS, BaaS, and PaaS. All those labels have started to confuse more than they help. In short:

  • IaaS, i.e., Infrastructure as a Service, gives you granular control over your product’s underlying infrastructure. Use IaaS if controlling your infrastructure yields substantial benefits or if there are no other technical ways to implement your product (e.g., optimizing server lifecycle to decrease operational costs, or strictly controlling your network because of critical security concerns).
  • SaaS, i.e., Software as a Service, provides features to your product that significantly improve it, so you don’t have to build them yourself. Use SaaS whenever you can, unless it dilutes your margin so much that it legitimizes developing that set of features yourself.
  • PaaS, i.e., Platform as a Service, allows you to focus on writing code without worrying about the underlying infrastructure. Beyond writing code, the only extra complexity might be around deployment and configuration (e.g., automatic scaling rules, geo-replication).
  • Serverless overlaps with PaaS and falls into two categories: BaaS and FaaS. Like PaaS, Serverless focuses on writing code without worrying about the underlying infrastructure, but it does it with even more deployment ease and even less configuration.
  • BaaS, i.e., Backend as a Service, is a Serverless backend (e.g., DB, hosting), i.e., a highly-available backend that can be set up with barely any configuration and can scale almost infinitely. Once created, the developer focuses on deploying code or data only.
  • FaaS, i.e., Function as a Service, is a Serverless product that hosts a piece of business logic (with a usually small footprint like resizing an image or sending an email). FaaS is very well suited to build Event-Driven architecture.

Now that we’ve disambiguated those terms, we can dive deeper into what Serverless does, as well as the trend that led us here and that will most probably lead us to the next Cloud milestone; whatever it is.

What Serverless Does and How We Got There

In How The Cloud Is Automating IT Engineers & Reshaping Tech Leadership, we briefly covered the evolution of the Cloud up until now. We concluded that:

The Cloud reduced considerably the number of IT engineers required to operate a digital business, consequently reshaping the technical leadership inside organizations.

The oversimplified example of an e-commerce website illustrated the evolution of the business’ taxonomy before and after the Cloud:

10 Years Ago — On-Premise Powered E-Commerce

Figure 1 — On-premise (Originally posted in How The Cloud Is Automating IT Engineers & Reshaping Tech Leadership)

5 Years Ago — Mix of Cloud & SaaS Powered E-Commerce

Figure 2 — Cloud & SaaS (Originally posted in How The Cloud Is Automating IT Engineers & Reshaping Tech Leadership)

2018 — Mix of Serverless & SaaS Powered E-Commerce

Figure 3 — Serverless & SaaS (Originally posted in How The Cloud Is Automating IT Engineers & Reshaping Tech Leadership)

Serverless is the most recent Cloud iteration; another architecture that enables fewer software engineers to accomplish more and spend less time on operational maintenance.

Serverless products will host some or all of your application logic. It can do the same with your data. It is different from a SaaS (Software as a Service) which does not host your intellectual property. Instead, a SaaS provides an essential service (e.g., sending emails) part of your proprietary solution that you would have to build if it did not exist.

Differentiating between Serverless and SaaS is easy enough, but why is Serverless also different from the Cloud as we know it, i.e., PaaS (Platform as a Service)? Well, it is not. Serverless is just a new extension of PaaS, and that’s why, from one article to another, the same product is labelled Serverless or PaaS (e.g., Google Cloud PubSub). Both of those terminologies are correct. Those who argue differently are not paying attention to the elephant in the room: The Cloud is automating IT engineers. Serverless is just moving one step further.

Serverless marks a new milestone in the Cloud’s journey: The automation of the DevOps engineer.

So if you’re still wondering what a Serverless product is, our rule of thumb is to ask yourself this question:

Do you need a dedicated engineer (DevOps)to manage your infrastructure so that your product can scale and failover while being secured and highly available?

If the answer is no because your software engineer can merely push his/her code to a product that delivers all those features out-of-the-box, then those products can be called Serverless. This definition is loose but clear enough so we can focus on what matters: Getting shit done!

To recap, using our rule of thumb:

  • SendGrid is a SaaS that your application can use to send emails without having to host, configure, or manage your SMTP server.
  • Zeit Now, Google Functions or AWS Lambda are Serverless solutions that can host your web app. Write your code, then deploy it with a single command.
  • Firebase and DynamoDB are NoSQL Serverless databases that host your data.
  • AWS EC2 is NOT serverless, but rather an IaaS. You need to choose an OS and a server size, configure your machine, as well as define how to provision it before you can start deploying your first application.

Before looking into the use cases where Serverless are useful or not, let’s make one last clarification between the two different Serverless categories: FaaS & BaaS.

FaaS, i.e., Functions as a Service

FaaS are small pieces of your app’s business logic powered by services such as:

  • Google Functions: Functions triggered by various Google products (e.g., Google PubSub, Google Storage, Firebase, HTTP requests).
  • AWS Lambda: Functions triggered by various AWS products (e.g., AWS Kinesis, AWS S3, AWS Dynamo, HTTP requests, …). This list of event sources for AWS Lambda is large as it is a more mature product than Google Functions. You can find an exhaustive list here.
  • Fly Edge Apps: Javascript Apps on Edge CDN (only react to HTTP requests).
  • Cloudflare Workers: Javascript Apps on Edge CDN (only react to HTTP requests).

These functions are usually small pieces of code that react to predetermined events (e.g., a file change in your Cloud storage, a message in your queue, or an HTTP request). An example would be sending a welcome email when a new user is inserted into your Firebase database. If you want to read more about what’s possible with FaaS, Leveraging AWS Lambda for Image Compression at Scale is a great article.

If you’re still not entirely sure to understand what separates BaaS from FaaS (e.g., what is different from Zeit Now and Google Functions) yet, the next section will dig a bit deeper.

Backend as a Service & Functions as a Service

BaaS, i.e., Backend as a Service

BaaS are pieces of infrastructure that will host your app or its data with almost no configuration required. That type of backend should theoretically scale infinitely while still being highly-available and fault-tolerant. Some popular examples are:

Databases:

Hosting:

Data ingestion:

This definition of BaaS is broader than what it used to be. Indeed, in the beginning, the industry was limiting itself to what was known as MBaaS, i.e., Mobile Backend as a Service. MBaaS was more restrictive than the above description. To be labelled as MBaaS, a product had to offer an API that covered push notifications, user authentication, storage, and, ideally, SDKs. Those specifications would have removed most products from the list above, except for Firebase. So what’s changed? The rise in popularity of FaaS proved that there was a growing demand for more Cloud services with almost no infrastructure configuration and maintenance (the term that often references that trend is NoOps). AWS recently released Aurora Serverless, a Serverless SQL database with no push notifications, user authentication or SDKs out-of-the-box. With this new product, AWS is enlarging the BaaS and Serverless brand, which changed the previous specification.

How To Choose Between BaaS or FaaS?

In most cases, deciding between a BaaS or a FaaS is quite straightforward. Use:

  • BaaS when you only need a piece of infrastructure to host or transfer data (e.g., Firebase if you need a database or Google Pub/Sub if you need data ingestion at scale).
  • FaaS when you need some small piece of business logic (e.g., sending an email) to execute when a specific event occurs (e.g., a document has been uploaded to Google Storage).

However, when it comes to hosting an app such as a website or a web API, what separates BaaS from FaaS becomes blurry. Indeed, in that case, both a BaaS solution like Zeit Now or a FaaS solution like Google Cloud Functions could do the job. Our next article about Serverless Mistakes discusses in greater details why we think a BaaS like Zeit Now is better suited for those types of scenario, and what we’ve learned from our mistake when we hosted a GraphQl API on Google Cloud Functions.

Is Serverless For You?

The list below describes various scenarios for which some Serverless solutions might be relevant.

JS Dev — You’d be nuts not to use it

Javascript is the de facto language for most Serverless solutions. It is by far the easiest way to start (as of early 2018, Google Cloud Functions only support Javascript). Some solutions like Zeit Now were initially tailored for node.js. Check out our tutorial in Why We Love Zeit Now & When To Use It Over FaaS, where we explain how to write a simple REST API and deploy it to Zeit Now, AWS Lambda and Google Cloud Functions. As for Serverless databases like Firebase or Serverless data ingestion tools like Google PubSub, they usually provide SDKs that help with most popular languages.

Non-JS Dev — Plenty of goodness, especially if you know Docker

If you’re not a JS dev, like we said before, you can still leverage most Serverless solutions as they usually provide SDKs for the most popular languages. It is, however, a bit more restrictive as specific solutions do not support other languages other than Javascript at this stage (e.g., Google Functions, Fly Edge Apps, Cloudflare Workers). However, some others support Docker containers (e.g., Zeit Now), so if you’re comfortable with containers, this gives you an excellent alternative.

Side Projects & Startup Founders — Welcome to Lean, Fast & Free

If you’re bootstrapping a startup or wanting to kick off an idea you’ve had in the back of your mind for a while, then a Serverless stack is the fastest way to get moving. Not to mention almost all solutions offer a usually generous free tier that will allow you to get pretty far without paying a cent. Right now, we don’t think there is any better stack to power the Lean Startup’s Build-Measure-Learn mantra.

Microservice & Event-Driven Architecture — A natural fit

This topic excites us a lot. If you’re interested in knowing more, a dedicated post is coming soon. In the meantime, you can read the excellent article The challenges of developing event-driven serverless systems at massive scale.

Refactoring Legacy Project — Great to focus on business logic

Refactoring a legacy project is rarely a dream story. In our experience, more often than not, the main challenges come from understanding and adapting the business logic rather than re-writing the code. In this situation, having a stack allowing for fast, cheap and almost infinite deployments at your disposal can help you focus on sorting out the business logic.

Security, Compliance & SLAs — Hopefully your boss is ok with the Cloud

Serverless shares all the usual grievances associated with other Cloud technologies. You are giving up control of your infrastructure to one or multiple 3rd parties. Depending on the vendor, Serverless may or may not provide the right SLA and security levels for your business case. At this point, it depends on what your business’ priorities are. Serverless is still in its infancy. If some pieces of logic and data are highly sensitive or mission critical to your business, and if you have the budget, time and expertise to maintain those pieces through other more reliable means, then we recommend that you do so. However, the Serverless architecture is rapidly maturing. It is a matter of time until its reliability reaches your desiderata.

CONCLUSION

So far, our team has been delighted to integrate more and more Serverless solutions into our stack to build our latest web and mobile apps for our clients in Sydney. Is Serverless a revolution? No, but it is undoubtedly an extremely valuable evolution of the Cloud in general. Serverless is another incremental way the Cloud can help test ideas to get them to market faster and more efficiently. The gain in productivity for our team has been undeniable, and unlike other much-hyped techs these days, it has delivered measurable value; something we believe is essential for any great product or service.

If Serverless falls short of your expectations and more control over the underlying OS is required, PaaS is still a great alternative, especially with the latest advancements in containerization. Google Kubernetes Engine, for example, can significantly simplify your deployment to abstract the underlying infrastructure.

In any case, there are more an more tools and ways to create digital products than ever before. We are very curious to see what that next stage of the Cloud will be and if that one will finally start automating Software Engineers.

COMING NEXT…

This post is part of our series about Serverless. Follow me on Medium — Nicolas Dao — if you’re interested in what’s coming next:

--

--

Focused on nurturing happiness in tech. and in life. Co-founder of Neap (https://neap.co), a Tech. Consultancy based in Sydney.