Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
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? Why can it be beneficial to me now? This post, we will attempt to answer all those questions briefly. We’ll be focusing more on what Serverless does, rather than on what it is, as we are not interested in arguing about the specific traits of a Serverless product.
Other topics that will be discussed later in this series will cover subjects such as:
- Mistakes You Should Avoid With Serverless.
- Weaknesses Of Serverless and How To Overcome Them.
- Serverless Comparison.
- Why We Love Zeit Now & When To Use It Over FaaS.
- Serverless Event-Driven Architecture: The Natural Fit.
- How To Manage Back-Pressure With Serverless?
- GraphQL on Serverless In Less Than 2 Minutes.
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-CommerceFigure 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-CommerceFigure 2 — Cloud & SaaS (Originally posted in How The Cloud Is Automating IT Engineers & Reshaping Tech Leadership)2018 — Mix of Serverless & SaaS Powered E-CommerceFigure 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) or an IaaS (Infrastructure as a Service)? Well, it is not. Serverless is just the new generation of those paradigms, and that’s why, from one article to another, the same product is labeled 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: BaaS & FaaS.
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. Some popular examples are:
Databases:
- NoSQL: Google Firebase, Google Cloud Firestore, AWS DynamoDB
- SQL: AWS Aurora Serverless
- Data Warehouse: Google BigQuery
- Files: AWS S3, Google Cloud Storage
Hosting:
Data ingestion:
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.
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 at Neap has been delighted to integrate more and more Serverless solutions into our stack. 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.
When it comes to human automation, AI gets all the press these days. IT engineers often think they still have some happy days in front of them before they are made redundant, but that’s a mistake. The Cloud is automating engineers, and it will carry on doing so after Serverless. We are very curious to see what that next stage 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 — Neap Nic — if you’re interested in what’s coming next:
- Mistakes You Should Avoid With Serverless.
- Weaknesses Of Serverless and How To Overcome Them.
- Serverless Comparison.
- Why We Love Zeit Now & When To Use It Over FaaS.
- Serverless Event-Driven Architecture: The Natural Fit.
- How To Manage Back-Pressure With Serverless?
- GraphQL on Serverless In Less Than 2 Minutes.
THE SERVERLESS SERIES — What Is Serverless? was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.