Your Privacy

This site uses cookies to enhance your browsing experience and deliver personalized content. By continuing to use this site, you consent to our use of cookies.
COOKIE POLICY

Functions As A Service

Functions As A Service
Back to insights

More and more development teams are choosing to move parts of their infrastructure into the cloud and even opting for cloud-based or “serverless” architectures.  Like all things technical there are several costs and benefits to going serverless.  We’ve covered some of these in previous articles:  Understanding Serverless Computing and The Cost of Abandoning Infrastructure.  Functions as a Service (FaaS) is one of many approaches to serverless computing.

No Server?

A serverless architecture does not mean there are no servers involved.  It just means the physical server (along with its setup and maintenance) is abstracted away from the customer.  For example, Infrastructure as a Service (IaaS) provides a managed abstraction of lower level hardware resources including networking, computing and storage.  Platform as a Service (PaaS) goes a step further by offering a fully managed development and deployment environment including operating systems, databases, middleware and other tools. Both of these can be scaled automatically and are priced based on usage.  This cloud-based approach can save customers money that would be spent on underutilized hardware resources as well as countless man hours standing up and maintaining physical servers along with the software running on them.

Functions as a Service (FaaS) takes this abstraction a step further.  Along with the hardware, os and middleware, FaaS abstracts away the runtime environment.  Developers publish small blocks of code which are executed in containers on demand.  These containers may have their own memory and processing specifications and can scale independently.  Functions can be triggered by a variety of events (depending on the vendor) including schedule, file updates, message busses and http requests.  They can also be combined with other cloud services including database storage, messaging, API calls, etc.

Benefits

Flexibility: The higher resolution of scalability allows development teams to be very specific about how their software should scale.  For example, it may be very important that certain API endpoints respond as quickly as possible but not so important that all log events are handled instantly.

Cost: Scaling at the function level means that you don’t have to pay to scale up an entire server just because a few of the functions it provides are in demand.  Since cost is determined by actual execution time, it becomes much more cost effective to create multiple development environments (dev, qa, prod or even by team, project or feature).

Simplicity: Each FaaS function should be relatively small and have a single responsibility.  This makes each function easier to maintain and reason about.

Speed to Market: Modern vendors like Azure and AWS allow users to deploy new or changes to functions within minutes.

Continuous Integration: The atomic nature of FaaS functions can help facilitate automated deployment and testing.

Considerations

Lightweight functions: FaaS compute instances tend to have resource and execution time limitations that may make them unsuitable for heavy lifting.

Potential delays: Since code is executed on demand, compute instances are “spun down” when they haven’t been used for a while.  This can lead to longer than usual execution times when a function is called for the first time.

Complexity: Because instances of code are executed independently and in parallel. there are more moving pieces to reason about.  This also increases the potential surface area for attack.  Developers will need to consider the minimum level of access an individual function needs to operate.

Debugging: In its current state, it is not trivial to debug within FaaS functions. Because the runtime is abstracted away, it may be difficult to replicate the exact runtime conditions of a function locally.

Dependency: At the end of the day “the cloud” is just someone else’s computer.  All of the same risks apply.  By moving toward a cloud-based infrastructure, a company must give up some control and depend on a third party.  This may not be acceptable for some mission-critical systems.

FaaS Changes How You Code

In order to operate most efficiently, FaaS functions should be concise, stateless and assume parallelism.  Development teams moving to FaaS will likely have to change the way they organize their code to make it performant.  FaaS also demands a more holistic view of the solution from the earliest phases of feature development.  In order to properly configure triggers and outputs of functions, developers must consider how new functions fit into the overall architecture of a system.  Since security and performance capabilities are configured per compute instance, developers using FaaS will now have to consider those elements at the earliest phases of development.  This can expose potential blockers that wouldn’t normally be revealed until code is deployed to a live environment.  Finally, since the cloud is not infallible, it is wise for development teams to consider what would happen if (when) functions fail and develop fallback strategies to degrade gracefully.

Is FaaS for Me?

The answer to this question, like most in the tech world, is “it depends.”  FaaS offers a lot of potential savings in terms of man-hours, headspace and cost while increasing the responsiveness, scalability and durability of a software system.  On the other hand, it can mean a fundamental change in code architecture, internal processes and development approach.  Fortunately, you can move towards FaaS incrementally making small changes to your architecture and processes, learning as you go.

Digging In

  • Digital Products

    Unlocking Business Potential: The Power of Custom Application Development

    Like any savvy business leader, you’re likely always on the lookout for tools to give your company a competitive edge. And in doing so, you’ve undoubtedly considered investing in custom application development. But the question is, how do you ensure that such a major investment in a custom web application development provides a strong return on […]

  • Digital Products

    Mastering Legacy Application Modernization: Strategies for Success

    The ironic truth of the business world is that change is the only constant. But this means that failing to keep pace with the competition and its technologies will only end with you falling behind. That’s where legacy application modernization enters the fold. When you modernize legacy applications, your team gains access to new features […]

  • Digital Products

    CTO Confessions Podcast

    In this episode of CTO Confessions, Rob Phillips, the Vice President of Software Engineering at UDig, digs into his journey from a passionate technologist in his youth to a seasoned leader in the tech industry. He shares valuable lessons on transitioning to senior leadership, the importance of understanding and articulating company problems, and the art of empowering teams for high performance.

  • Digital Products

    Navigating the Challenges of On Premise to Cloud Migration

    In today’s rapidly evolving technological landscape, the shift from on premise solutions to cloud-based infrastructure has become a pivotal transformation for organizations seeking to modernize their IT operations. This transition holds the promise of increased agility, cost savings, and enhanced scalability. However, it is not without its set of formidable challenges that organizations must navigate. […]

  • Digital Products

    The Power of Transferrable Skills in Tech Projects

    Every project has its own unique elements that require flexibility to be effective and achieve success. This often requires picking up new pieces of a tech stack, learning a new programming language, or a new project methodology. Fortunately, there are also many transferrable skills that carry over from one project to the next. In my […]

  • Digital Products

    The Four Pillars of Effective Digital Product Development

    In 2020 alone, approximately two billion consumers purchased at least one digital product. From software licenses to mobile apps and tech tools, consumers are becoming increasingly active in the digital product market, a trend that has naturally spurred brands across a wide range of industries to reevaluate their digital product design and development process workflows. […]