Pros and Cons of Function as a Service (FaaS)

Looking for freedom from servers? Serverless computing may provide you with a cost-effective way to deploy and scale applications.

Function as a Service (FaaS), or serverless computing, gives you the option to purchase backend services from a vendor for your cloud applications rather than deploying and maintaining servers of your own. You divide your application into “functions,” which are parts of your application that are triggered by specific events. You can then upload the functions onto the vendor’s FaaS platform and attach the event source.

Eliminating on-premises servers can provide substantial benefits to a software company, but FaaS advantages don’t stop there. Consider the impact FaaS could make on your business in these areas as well:

  1. Costs: Typically, you only pay for the service you use. You don’t have to pay in advance for a specific amount of bandwidth as you would with vendors using a server allocation model.
  2. Easy scalability: Applications built on FaaS platforms scale automatically with the number of users or usage. The vendor, not the developer, manages scaling.
  3. Simplified code: With FaaS, you have the option to upload one function at a time or your entire application all at once. FaaS also gives you the freedom to write backend code for independent functions, similar to microservices.
  4. Decreased latency: The FaaS vendor may have the capability to run applications closer to end users, eliminating the need for requests to travel long distances to an origin server.
  5. Faster time to market: Function as a Service supports iterative development, getting applications up and running sooner, and allows you to make modifications more easily.

Trade-Offs You May Need to Make to Use FaaS

There is a potential downside to using Function as a Service. Some of the things you need to consider before you go all-in with FaaS include:

  1. Vendor lock-in: Building your application on a FaaS platform may make you reliant on that vendor and make it difficult to switch.
  2. Testing hurdles: Depending on the vendor, you may have challenges when creating a test environment for your application.
  3. Cold starts: There’s sometimes a delay in the execution of a function, as much as 3 seconds, which can adversely impact some types of applications.
  4. Security: You are at the vendor’s mercy when it comes to security and may not have the visibility you need to ensure the vendor complies with regulations governing your use or storage of certain types of data.
  5. Cost: This item is repeated from the benefits list, but in some cases, FaaS can actually cost more than using dedicated servers, depending on the processes you are running.

FaaS or Containers?

Your only options aren’t on-site servers, allocating space in a server farm or FaaS. You also have the option of containerized applications or microservices. You can move containers that include your application and everything it needs to run, as needed, and manage them with Kubernetes. In most cases, FaaS is more cost-effective and scalable, but containers, which run the same way regardless of where they are deployed, are easier to test and aren’t dependent on a specific vendor’s platform. Containers may also be the best choice for migrating legacy applications to the cloud.

It’s also important to realize that the architecture you choose doesn’t have to be all or nothing. It’s possible to have some functions on FaaS and others in containers. Your skills as an innovator and a developer can also help you determine the best way to manage your applications. FaaS or a hybrid solution may be the best course.

Mike Monocello

The former owner of a software development company and having more than a decade of experience writing for B2B IT solution providers, Mike is co-founder of DevPro Journal.

The former owner of a software development company and having more than a decade of experience writing for B2B IT solution providers, Mike is co-founder of DevPro Journal.