Serverless for Dummies
by Eric Goebelbecker
Imagine a technology that lets you focus on your business logic and that takes care of issues like reliability and scaling for you. What would it be like if you only had to pay for the computing time you use rather than pay by the day, month, or year? That technology is serverless computing. By taking on the time and expense of managing servers for you, cloud vendors make it easier for you to focus on your business and get applications on the air quickly.
Let’s talk about what serverless computing is and how it can help you.
What is Serverless Computing?
Serverless computing is a cloud architecture where you don’t have to worry about buying, building, provisioning, or maintaining servers. In return for structuring your code around their APIs, your cloud provider takes care of all that work for you. Let’s go over some of the more common serverless computing offerings.
Functions As a Service
Many people immediately think of Functions as a Service (FaaS) when they think of serverless computing. It’s the most widely used implementation of this type of architecture, and it’s popular for several practical reasons.
With FaaS, you upload your code to your cloud provider, and they run it for you. Depending on how you configure your function, they’ll scale it based on how many clients request it simultaneously, and you pay based on how many times your function runs.
This power is not free; your code has to be written like a function. Each cloud provider publishes an API, usually in several different programming languages, with rules about what can be passed to your code and what you need to return. There are some limitations to what a function can do, which we’ll cover below.
Popular examples of FaaS are Amazon’s AWS Lambda, Google’s Cloud Function, and Microsoft Azure Functions.
Database As a Service
Database as a service (DBaaS) is exactly what the name implies. Instead of maintaining your own database server, either on premises or on a cloud virtual machine, the cloud vendor maintains the database server for you.
The pricing model for DBaaS is based on how much data you store and how often you access it. Depending on how you use it, this is often much less expensive than paying for the dedicated cloud servers and storage you need to run a reliable database cluster.
Amazon’s AWS offers several different DBaaS products, including DynamoDB and Aurora. Google offers Firebase, while Microsoft has Azure Data Lake.
Storage As a Service
Storage as a service (SaaS) is on-demand cloud storage. Like the computing model in FaaS and DBaaS, you pay for the storage you need as long as you use it and for each time it’s accessed.
Unlike the storage you buy when you set up cloud servers, you can use this storage anywhere. You can limit it to your cloud resources, or you and your clients can access it from the Internet. You can also specify what kind of redundancy or backups you need.
Amazon’s AWS Simple Storage Service (S3) is one of the most widely used SaaS products. Azure Storage and Google Cloud Storage are two more examples.
Why Use Serverless?
Pay As You Go
In contrast to cloud servers and standard cloud storage, serverless services bill you for what you use.
With virtual machines, you pay for the resources allocated to each virtual machine. So if you think your server’s peak memory usage will be 32GB, you have to allocate that memory in advance, even if that peak only lasts for a few minutes a day. Likewise with CPU and disk utilization. You have to estimate what your system will need and pay for the maximum.
With serverless, your costs start at zero and go up based on usage. So with storage as a service, you pay for the storage you use. As storage goes up, you pay more; if it does back down, you pay less. With DBaaS, you pay for storage and usage. For FaaS, you pay for how often your functions run.
Serverless Means Less Time Spent on Servers
The cost savings with serverless doesn’t stop with how much you pay for the services. How much money do you save by not having to maintain servers?
Whether you’re running them in the cloud or on premises, servers have to be created and maintained. They need software patches, and they have to be monitored. Database servers required highly specialized staff.
In other words, they require engineering staff that, instead of focusing on your business issues and clients, are taking care of servers.
Serverless eliminates these tasks, which means that you need fewer engineering staff, and the staff you do have is working on your business applications.
Serverless Means More Time Spent on Your Business
One of cloud computing’s success stories is how it has helped businesses spend less time on infrastructure and more time on business problems. Serverless computing is a logical step in that process.
If your engineering staff doesn’t have to keep infrastructure running, they have more time to focus on the problems that are unique to your business.
The change in focus applies to your development staff too. Most of their design and implementation effort is spent on solving your business problems and improving your customer’s experience. FaaS APIs are relatively simple, so the bulk of their work is spent on developing functions that apply to your business and getting them to work together.
Serverless Means Scalability and Reliability
Even though they’ve been mentioned a few times above, scalability and reliability are worth mentioning again.
When you use FaaS, your cloud provider runs your functions on their servers. Keeping those servers running is their problem, and they’ve proven their ability to run reliable systems.
When you provision a function, you set a budget. Based on how much you’re willing to spend, the provider will run more or fewer functions based on demand.
DBaaS and SaaS come with scalability and reliability baked in too. Here again, you may have to pay more, but you don’t have to design or maintain it either.
Why Not Use Serverless?
Serverless sounds like a breakthrough in cloud architecture and a game changer for building a scalable, reliable, and cost-efficient architecture. But it’s not for everyone, and there are some downsides.
A FaaS application isn’t really an application. It’s a function in the programming sense. You call it with a set of inputs, and it responds with a result. Each time you call the function with that set of inputs, the result must be the same, or there’s something wrong with the function.
Functions can’t rely on storing information in memory since they can be stopped and started at any time by the cloud provider. That’s how they’re able to offer you scalability on demand. Your functions can store information in a database or file storage, though. Functions also have time limits placed on them, so they can’t spend too much time communicating with external resources.
Client applications can’t rely on being connected to a single instance of a function either, for the same reason. That function might not be there anymore since the cloud infrastructure creates and destroys them on the fly. Any application state has to be stored in the client application or in data stores that your functions can access very quickly.
Moving an app to FaaS, or designing a new one for it, means decomposing it into functions. Each one of these functions needs to be fast and essentially stateless. This kind of architecture was common even before the rise of FaaS, but any legacy applications aren’t a good fit and need to be rewritten from the ground up.
Cloud infrastructure always comes with the risk of vendor lock-in. Cloud vendors have different ideas on how things should work, and they don’t want you to leave their infrastructure for another.
SaaS services have unique APIs and their own quirks. While many DBaaS services use standard database services under the covers, they all have their own specific ways of managing connections and authentication.
FaaS implementations have their own APIs and limitations on which back end services function can access and how they are reached.
Serverless Computing is Here to Stay
We’ve covered what serverless computing is, what some different serverless offerings look like, and how you can use them to improve your IT infrastructure. It can help you save money and shift your focus to what makes your business special. It’s time to take a look at how serverless can help you take your IT to the next level.
This post was written by Eric Goebelbecker. Eric has worked in the financial markets in New York City for 25 years, developing infrastructure for market data and financial information exchange (FIX) protocol networks. He loves to talk about what makes teams effective (or not so effective!).
24JUNE, 2021 by Omkar HiremathInformation technology and the digital world don’t exist without data. The data of an organization can contain a lot of unclassified, as well as classified information. Irrespective of that, only authorized personnel should have access to...
14JUNE, 2021 by Kathrin PaschenManaging releases at scale is daunting. It involves juggling dependencies, timelines, and requirements. The stakes can be pretty high, too. Not all failures are as spectacular as crashing a lunar lander or losing $440 million. Even so,...
28MAY, 2021 by Sasmito AdibowoThe benefits of using cloud environments to store and access data over the Internet has been highly beneficial for many businesses. Cloud environments help both start-ups and enterprises scale up conveniently. However, as with other major...
21APRIL, 2021 by Zulaikha GreerWhat Is Privacy by Design? Millions of dollars go into securing the data and privacy of an organization. Still, malicious attacks, unnecessary third-party access, and other data security issues still prevail. While there is no definite...
31MARCH, 2021 by Ukpai UgochiSo, As the leader of a DevOps or agile team at a rising software company, how do you ensure that users' sensitive information is properly secured? Users are on the internet on a daily basis for communication, business, and so on. While...
24MARCH, 2021 by Taurai MutimutemaKnowledge is more important than ever in businesses of all types. Each time an engineer makes a decision, the quality of outcomes (always) hangs on how current and thorough the data that brought about their knowledge is. This...