Function as a Service (FaaS): Everything You Need To Know

You’ve likely heard of SaaS, and you may have heard of PaaS and IaaS, but have you heard of Function as a Service (FaaS)?

The FaaS market is growing quickly. According to Allied Market Research, the market was worth $3.01 billion in 2018. This number is expected to grow to $24 billion by 2026 — meaning the industry will grow at a Compound Annual Growth Rate (CAGR) of 29.7% from 2020 to 2026.

Looking at that growth, it’s safe to say FaaS is a pretty big deal.

But what is FaaS, and how does it work? To help you answer those questions, this article will cover the basics of FaaS, why people should (and shouldn’t) use FaaS, and the state of the global FaaS market as of 2022.

Let’s go.


What is Function as a Service (FaaS)?

Function as a Service (FaaS) is a form of cloud computing that helps developers work better by removing the need for them to maintain application infrastructure. When developers leverage FaaS, they use a FaaS platform to build, run, and oversee application packages for them.

At this point, you might think that FaaS sounds like serverless computing — and it is. Serverless computing allows developers to outsource managing databases, API gateways, storage, messaging, and other infrastructure to a third-party provider. FaaS is a type of serverless computing.

An image showing how serverless computing works
How serverless computing works (Source: iviewlabs)

Though this may be the first time you are reading about FaaS, you have likely encountered it in the wild. Many popular programs and apps use FaaS — like Amazon’s Alexa.

If you’re familiar with Alexa, you’ll know that you can expand Alexa’s functions by building “skills.” Like apps, skills let Alexa do things outside of its basic configuration. Things like checking for notifications in your app, starting a new chat, or playing custom audio.

Amazon runs all of Alexa’s skills through AWS Lambda. When you build a new skill, you create it as a function that you deploy through AWS Lambda. AWS Lambda then runs the function for you and handles infrastructure concerns like security and database management.

So, how does FaaS work step-by-step? Let’s cover that next.

What is FaaS? ?This guide breaks down everything you need to know ✅Click to Tweet

How Does FaaS Work?

To understand FaaS, you need to know two key terms:

  1. “Monolithic architecture” = a self-contained application that runs independently from other applications. These applications manage the user interface, business functions, and data interface in-house. Monolithic architecture code relies on other pieces of code.
  2. “Microservice architecture” = a piece of code that handles a few small tasks. These microservices are separate (though they make up a whole application together).

Here’s a diagram that shows how monolithic architecture and microservices architecture differ:

Monolithic architecture vs. microservices architecture
Monolithic architecture vs. microservices architecture (Source: BMC)

You can see the main difference in practice between microservice and monolithic architectures when you execute or update a function. With a monolithic architecture, the whole program executes the function at once (like updating an app, for example). With a microservice architecture, you can execute the microservice function independently.

FaaS is the thing that helps microservice architectures work.

When you execute each new microservice function, you only need to create the function. Then, your FaaS provider takes the function, runs it, and handles the management of the function from then on.

Because FaaS is a tool that works with input from you, it’s crucial to note that each FaaS function should only be responsible for one task. This task then runs when its trigger is activated. For example, a function that produces a copy of the user’s receipt will only work if the user presses “download receipt.”

FaaS uses the “event-driven execution model,” which means that your functions only activate when triggered. Similarly, they don’t run in the background.

So, what else can FaaS do?

What Services Does FaaS Include?

Though all providers are different, FaaS providers generally offer these services:

  • Authentication services. These handle the log-in and authentication processes for your program’s users.
  • Database services. These help you file information in databases so that your program can use it. FaaS providers manage some database maintenance for you.
  • File storage. FaaS providers can store data and files for your app, so you don’t need to host it on your own server.
  • Reporting. FaaS providers can watch for errors or security threats in your program and alert you when they find something amiss.

Overall, these services help developers work smarter. Let’s cover the pros of FaaS next.

Pros of a FaaS Model

With FaaS, developers don’t need to worry about infrastructure or deployment — only writing application logic. Thus, when implemented currently, FaaS can greatly reduce the time it takes to build and deploy a program.

Building and deploying are also easier with FaaS. The provisioning time only takes a few seconds rather than hours at a time. You aren’t limited to particular languages or resources, either. FaaS providers can run code in most languages, and you can speed up the building process by using the caches and databases your provider offers.

The FaaS model is very scalable, and capacity planning is far easier. If you need more resources, you can simply refer to your FaaS provider’s instructions to upgrade your use. Many FaaS providers offer horizontal scaling, meaning if your use spikes, the provider will simply provision you extra resources to cope with the spike.

Additionally, you don’t need to worry about maintenance, Disaster Recovery (DR), or security.

Finally, FaaS is very efficient. Providers only charge you for the resources you use, so you’ll likely pay far less for FaaS than you would for your own hardware. Similarly, your functions don’t run in the background and sit idle instead. You don’t need to pay for them to idle, either.

So, is FaaS all-pros? Not quite.

Cons of a FaaS Model

The FaaS model removes some of the biggest challenges associated with program development, but it also requires you to limit your control substantially. You can’t make many decisions about the server, security, or database your code uses. Instead, it’s up to your provider.

In a similar vein, debugging is often a little harder as you don’t have full control over your system. Testing is also difficult as FaaS code doesn’t always smoothly translate to the testing environment.

Additionally, you must adhere to the strict requirements of your FaaS vendor. FaaS functions can only complete one action, so if you aren’t used to this, you’ll need to change how you and your team write code. Similarly, you may need to rewrite code in existing apps to make it suitable for FaaS deployment — so FaaS is often better suited to new programs than old ones.

Finally, choosing FaaS often means committing to a single vendor long-term. You work with your provider’s system and requirements when you build your programs. Naturally, changing providers may require you to redo some of your work and potentially interrupt your functions.

Pros vs. Cons

Pros Cons
Deploy code faster

Provisioning takes milliseconds

Code in any language

Automated Disaster Recovery (DR)

Cost-efficient

Scalable

Lose control over server

Debugging is harder

Testing takes longer

You are locked in to your vendor

You must write FaaS-suitable code

FaaS vs SaaS, PaaS, and IaaS

Now that you know more about FaaS, you might wonder how it relates to other Anything as a Service (XaaS) options like IaaS, SaaS, and PaaS.

IaaS, PaaS, and FaaS services have similar purposes: they help companies manage applications cheaper and more effectively. However, each option offers something different.

Infrastructure as a Service (IaaS) allows you to rent out computing power (like RAM and CPU). With IaaS, you still need to manage some application functions (like security) in-house.

Platform as a Service (PaaS) allows you to rent out hardware and software tools to build your app. A common example is AWS Elastic Beanstalk.

Unlike IaaS and PaaS, FaaS allows you to rent space to run functions independently. This feature makes it more scalable.

Here’s a short summary of how the three work differently:

An image showing how How FaaS differs from IaaS and PaaS
How FaaS differs from IaaS and PaaS (Source: thenewstack.io)

Software as a Service (SaaS) isn’t geared toward app or program building. Instead, it allows you to rent applications so that you don’t need to build them in-house. There are thousands of SaaS options available — from data analytics tools to WordPress SEO plugins.

Market Size, Share, and Leading Vendors

The growth of FaaS reflects an overall shift in the way organizations are developing new programs.

In previous decades, developers created large systems as multi-year projects. Today, many organizations favor a Development Operations (DevOps) approach to development. DevOps prioritizes continuously developing and improving a program little by little.

An image showing how DevOps works
How DevOps works (Source: Atlassian)

Similarly, organizations increasingly use cloud services to make things safer and more efficient. According to Oracle, organizations will soon store 600 times more sensitive data in the cloud.

You can see this trend in data gathered from 7,164 C-suite executives from Statista. From 2019 to 2021, the use of a single public or private cloud service dropped, and most organizations adopted multiple cloud solutions.

A diagram showing the Use of Cloud Technology
Use of Cloud Technology (Source: Statista)

Investments in cloud computing are also growing. Another study from Statista on hundreds of large enterprises worldwide showed that 83% of surveyed companies invested more than $1.2 million into public cloud computing annually. This figure is up from 50% in 2019.

People are turning to FaaS because it’s future-proof and scalable. Similarly, it provides better productivity and performance, a faster time-to-market for apps, and a more cost-effective way to produce new programs.

These benefits attract many industries, including organizations in banking (or “BFSI” organizations), consumer goods and retail, entertainment, telecommunications, Information and Technology Enabled Services (ITES), healthcare, and manufacturing. Here’s how much each industry contributes to the FaaS market:

An image showing what industries use Faas
What industries use FaaS (Source: MarketsandMarkets)

Unlike SaaS, there aren’t thousands of FaaS vendors for organizations to choose between. The vast majority of FaaS uses solutions offered by major players, including AWS Lambda, Azure Functions, IBM Cloud Functions, Google Cloud Functions, Alibaba Cloud, and Cloudflare Workers.

We’ll cover each of these providers now.

AWS Lambda

Launched by Amazon in November 2014, AWS Lambda is an extremely popular FaaS tool. As of Q4 2021, 33% of cloud users used an AWS service.

AWS Lambda homepage
AWS Lambda

AWS Lambda offers native support for many programming languages, including Node.js, C#, Python, Ruby, Go, Java, and Powershell. As we mentioned in “What Is Function as a Service (FaaS)?” Alexa uses AWS Lambda for skills.

Features and Functions:

  • Connects to other AWS tools
  • Monitors your program’s performance with Amazon CloudWatch
  • Over 200 integrations with SaaS tools
  • You can deploy docker containers (AWS introduced this feature in December 2020)

Pros:

  • You can build your own backend using Lambda API or the Amazon API gateway
  • You can deploy functions as container images
  • You can connect to relational databases with Amazon RDS Proxy
  • You can choose how much memory to dedicate to each function

Cons:

  • If you don’t already use AWS, setting it up will take a lot of time and effort

Microsoft Azure Functions

Microsoft Azure Functions is a capability of Microsoft Azure, which Microsoft first launched as “Windows Azure” in February 2010. Azure Functions allows you to execute event-driven code via FaaS. As of Q4 2021, 21% of cloud users used Azure.

Microsoft Azure Functions homepage
Microsoft Azure Functions

Features and Functions:

  • You can connect your functions to 250+ connectors in Azure Logic Apps
  • Supports JavaScript, C#, F#, Powershell, PHP, Python, and Java
  • Provides many tutorials for new users
  • Helps you analyze your program through Azure Application Insights

Pros:

  • Azure Functions uses an integrated programming model
  • Well suited to teams using DevOps
  • Multiple plans available

Cons:

  • Azure Functions doesn’t support Node.js or Ruby

Google Cloud Functions

Google Cloud is the third most popular cloud computing solution behind AWS and Azure. It currently has a market share of 10%. Google Cloud Functions is a FaaS feature of Google Cloud — a service that offers over 100 products for a wide range of uses.

Google Cloud functions
Google Cloud

Features and Functions:

  • Debugging and logging is integrated into Google Cloud Functions (via CloudTrace and CloudDebugger)
  • You use triggers from Google Assistant, Google Cloud, Firebase, or any application using HTTP
  • Google Cloud Functions integrates with many Google partners

Pros:

  • Those wanting multi-cloud or hybrid capabilities can use it
  • It’s open-source, so you can easily move to another FaaS platform if you prefer
  • It’s very easy to use
  • Google provides many free resources to new users

Cons:

  • Google Cloud Function’s container-based services are less advanced than other FaaS providers

IBM Cloud

IBM Cloud came from SoftLayer, a public cloud platform that IBM bought in June 2013. IBM turned the platform into Bluemix and launched it as a PaaS tool in July 2014. Since then, IBM has rebranded the service as IBM Cloud and expanded its features into FaaS.

Struggling with downtime and WordPress problems? Kinsta is the hosting solution designed to save you time! Check out our features
IBM Cloud homepage
IBM Cloud

As of Q4 2021, 4% of cloud users have used IBM Cloud. It runs on the Apache OpenWhisk ecosystem.

Features and Functions:

  • You can search for video content
  • You can connect your program to other programs through IBM Watson APIs
  • IBM offers pre-built functions for some common tasks
  • Supports Node.js, Python, Swift, PHP, Go, Ruby, Java, and .NET Core

Pros:

  • Great for building mobile applications
  • Easy to learn to use
  • Monitors your app through IBM Cloud Monitoring

Cons:

  • Limits your function’s memory time to ten minutes or 2048 MB

Alibaba Cloud

Alibaba Cloud isn’t as widely known as other cloud computing options, but it still holds a decent market share of 6%. Launched by Alibaba in 2008, Alibaba Cloud is geared toward online businesses and those who use Alibaba’s other services.

Alibaba Cloud homepage
Alibaba Cloud

FaaS is one of Alibaba Cloud’s offers, alongside a Content Delivery Network (CDN), data storage, and big data processing.

Features and Functions:

  • Integrates with Alibaba’s other computing services
  • Disaster proof, as Alibaba hosts functions on clusters in multiple areas
  • Video transcoding
  • AI reasoning
  • Supports Node.js, Python, Java, PHP, and C#

Pros:

  • Provides a free option for those who don’t need to run much code
  • Highly scalable
  • You can use many types of triggers

Cons:

  • It can be difficult to move functions from Alibaba to another FaaS provider

Cloudflare Workers

Run by Cloudflare, Cloudflare Workers is a FaaS system that’s suitable for new developers and those looking to run code almost instantly. Cloudflare Workers offers a free plan and scalable pricing.

Cloudflare Workers homepage
Cloudflare Workers

Features and Functions:

  • Supports JavaScript, C++, Rust, and C
  • You can store images, PDFs, and other files on Cloudflare Workers to deploy as static assets
  • Disaster proof, as Cloudflare Workers uses a global network of servers
  • Integrates with other Cloudflare products

Pros:

  • It’s cheaper than many other FaaS options
  • It’s easy for newer developers to learn to use
  • You can get started very quickly
  • Cloudflare offers detailed tutorials and resources that can help you build your application

Cons:

  • Cloudflare Workers is less robust than other options and better suited to those with small-scale projects

Faas Best Practices

Yes, FaaS is a technology, but it’s also a mindset developers need to adopt towards program and application development.

To get the most from FaaS, follow these best practices:

  • Remember FaaS’ limitations. FaaS isn’t suitable for every program, and if you try to create a non-FaaS-friendly program with FaaS, it’ll cost you time, effort, and money.
  • Only run single action functions on FaaS. If you run functions with multiple actions, you disrupt the isolated environment FaaS functions work best in. This interruption will slow your application down and reduce efficiency.
  • Don’t run functions with dependencies. Dependencies will create errors and a scalability problem later.
  • Watch your load time carefully. Your load time comes from your libraries or functions that require a lot of memory. A high load time will slow down your program and ultimately frustrate users.
  • Reduce the number of Relationship Database Management System (RDBMS) connections you use. These connections will increase the time it takes for functions to work and introduce a point of failure into your program.

Do You Need FaaS?

FaaS is an innovative and game-changing technology for some, but it won’t work for everyone.

The organizations that get the most from FaaS are willing to build programs with microservice architectures where each function only does one thing. These functions should work independently — if they are dependent, you’ll run into scalability issues.

If you want to build an application with a monolithic architecture or functions that draw from each other, FaaS may not work well. Similarly, if you don’t want to commit to a single vendor long-term, FaaS could be a short-sighted choice.

Of course, you can still leverage cloud technology without FaaS. You could, for example, invest in PaaS or IaaS to outsource some of your application’s functions to the cloud. This option would give you some of the cost and efficiency benefits of cloud computing, but you wouldn’t need to build your program within the restrictions of the FaaS model.

Alternatively, if you don’t need to build a program that does something highly niche or specialized, consider investing in a SaaS tool. Some SaaS tools are even open-source, so you may be able to adapt an existing tool for your needs.

The FaaS market is expected to grow to $24 billion by 2026... so there's never been a better time to learn about this market ✅Click to Tweet

Summary

FaaS isn’t technobabble or a new trend. It’s a scalable technology you should expect to see more of in the coming decade.

Explaining FaaS can sometimes seem difficult, but FaaS is just a service that allows developers to write and run code using infrastructure maintained by someone else. Many services you regularly use, like Alexa, use FaaS. Common FaaS vendors include IBM Cloud Functions, AWS Lambda, Alibaba Cloud, Google Cloud Functions, and Microsoft Azure Functions.

While FaaS is highly effective for some businesses, it won’t suit everyone. FaaS works best for running isolated, stateless code that performs a single function.

We’d like to turn the microphone (or the keyboard) over to you. How do you use FaaS in your business, and do you have any advice for others exploring the technology for the first time? Please tell us in the comments below.

The post Function as a Service (FaaS): Everything You Need To Know appeared first on Kinsta®.

版权声明:
作者:ht
链接:https://www.techfm.club/p/31675.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>