Jump to content

Function as a service

From Wikipedia, the free encyclopedia
(Redirected from FaaS)

Function as a service (FaaS) is a category of cloud computing services that provides a platform allowing customers to develop, run, and manage application functionalities without the complexity of building and maintaining the infrastructure typically associated with developing and launching an app.[1] Building an application following this model is one way of achieving a "serverless" architecture, and is typically used when building microservices applications.

FaaS was initially offered by various start-ups circa 2010, such as PiCloud.[2]

AWS Lambda[3] was the first FaaS offering by a large public cloud vendor, followed by Google Cloud Functions, Microsoft Azure Functions, IBM/Apache's OpenWhisk (open source) in 2016 and Oracle Cloud Fn (open source) in 2017.

Use cases

[edit]

Use cases for FaaS are associated with "on-demand" functionality that enables the supporting infrastructure to be powered down and not incur charges when not in use. Examples include data processing (e.g., batch processing, stream processing, extract-transform-load (ETL)), Internet of things (IoT) services for Internet-connected devices, mobile applications, and web applications.[4] Another real-world use case can be creating APIs for already built applications without breaking down or modifying the current or existing functionality of the application.

Anti-Patterns

[edit]

A common anti-pattern in FaaS architectures is the "Grain of Sand Anti-Pattern", as coined by software architect Mark Richards. This anti-pattern arises when functions are made excessively fine-grained, performing only trivial tasks or overly specific operations. While modularity is a key advantage of FaaS, extreme fragmentation can lead to increased communication overhead, operational complexity, and reduced cohesion. Overly granular functions often require frequent interactions with other functions or services, resulting in higher latency and tightly coupled systems. To avoid this anti-pattern, functions should encapsulate meaningful business logic and strike a balance between granularity and cohesion. [5]

Portability issues

[edit]

Function as a service workloads may encounter migration obstacles due to service lock-in from tight vendor integrations. Hexagonal architecture can facilitate workload portability. [6]

Comparison with PaaS application hosting services

[edit]

Platform as a service (PaaS) application hosting services is similar to FaaS in that they also hide "servers" from developers. However, such hosting services typically always have at least one server process running that receives external requests. Scaling is achieved by booting up more server processes, which the developer is typically charged directly for. Consequently, scalability remains visible to the developer.[7]

By contrast, FaaS does not require any server process constantly being run. While an initial request may take longer to be handled than an application hosting platform (up to several seconds[8]), caching may enable subsequent requests to be handled within milliseconds. As developers only pay for function execution time (and no process idle time), lower costs at higher scalability can be achieved (at the cost of latency).

See also

[edit]

References

[edit]
  1. ^ Fowler, Martin (4 August 2016). "Serverless Architectures". Retrieved 26 January 2018.
  2. ^ "PiCloud Launches Serverless Computing Platform To The Public".
  3. ^ "Release: AWS Lambda on 2014-11-13". Amazon Web Service. Retrieved 26 February 2017.
  4. ^ "AWS Lambda – Serverless Compute - Amazon Web Services". Amazon Web Services, Inc. Retrieved 2018-05-04.
  5. ^ Richards, Mark. Microservices AntiPatterns and Pitfalls. O'Reilly.
  6. ^ Cui, Yan (2020). Serverless Architectures on AWS (2nd ed.). Manning. ISBN 978-1617295423.
  7. ^ Avram, Abel (25 June 2016). "FaaS, PaaS, and the Benefits of the Serverless Architecture". InfoQ.
  8. ^ "Dealing with cold starts in AWS Lambda". 17 April 2018.