# FaaS (Function-as-a-Service)

Function as a service — architectural pattern, suggesting the possibility of a call server code without having to manage servers and server application. This is one of the key component serverless (eng. "serverless") architectures. One of the first well-known implementations was presented in 2014, the service AWS Lambda. Similar proposals have with Google (Cloud Functions), IBM (OpenWhisk) and Microsoft (Azure Functions). Cloud Functions and Azure Functions released in 2016. OpenWhisk that shows the program is OpenSource / local system, showing similar features. FaaS-capabilities are also demonstrated on these private platforms as Schemaless triggers Uber.

The idea of "functions as services" is as follows: backend is broken down into a set of not preserving the state (eng. stateless) functions to handle events (which may be coming HTTP requests, new messages in the queue, the specified scheduler time, etc.). The condition in this case is understood in the context of development (eng. "deployment"), that is the execution result of the function should not depend on the memory status of the server (excluding the parameters passed in the call) and the content of the local file system. With such restrictions, the horizontal scaling is done by the provider, which can use any available to him at the moment, the computing device providing the required level of performance. Also, as a rule, the execution time of the function force is limited to a few minutes.[1]

## Compared with platform as a service hosted applications

Serverless computing architecture, where the client has no particular need to manage the resources, can also be achieved by using PaaS services. They are, however, usually vary widely according to the implementation architecture, which has implications for scaling. In most PaaS systems continuously operates at least one server process and even scaling some of the more long-running processes, just added or removed, so that the scalability is more visible to the developer as the problem.

In the FaaS system, it is expected that the functions are triggered within milliseconds in order to ensure the processing of individual requests. In PaaS systems, on the contrary, there is usually an application thread that continues to work long and handles multiple requests. This difference is mainly seen in the prices, where FaaS services, pay for the execution time of the function, while a PaaS-service — during the work flow, where the server application.[2]

## Peer-to-peer computing

Peer-to-peer computing, also known as function as a service (FaaS), model the execution of cloud computing when the cloud provider is in complete control of starting and stopping virtual machines as needed to serve requests and that requests are charged an abstract measure of resources required to satisfy the request, but not for virtual machinesby.

Oddly enough, the term actually implies the action code without servers. Serverless computing are so named because the company or person that owns the system is not obliged to buy, rent or commissioning of servers or virtual machines to run on server-side code.

Serverless code can be used together with code written in a traditional style server, like microservers. In this form, for example, can be written as part of the web application and the other as a peer-to-peer code. The application can be written entirely without the involvement of the server, thus being completely serverless.

Serverless code how to trigger specific events (such as registration of users using Amazon Cognito), and configure to work in support of the API-management platform, to present it as the end point REST API.[3]

## History

AWS Lambda was provided by Amazon in November 2014, became the first provider, where it was assumed serverless offer. Initially it started on Node.js as the only working environment, but for 2016 it is officially supported by the Python, Java and other languages, for example, Haskell can also be the initiator of the process Node.js.

Google has released an alpha version of a native peer-to-peer platform, called Google Cloud Functions, and supports Node.js.

In 2016, arrived, Microsoft, Azure Functions, half-baked technology that want to use public cloud Azure and any other cloud environment, public, private.

### Costs

Serverless computing can cost rather more profitable from the point of view of computing resources, rather than lease or purchase of a certain number of servers that usually involves periods of nedozagruzheny or non-use. They can be more profitable even in comparison with the initialization of the group of automaticremote, because these groups are usually designed nedozagruzheny that gives time for new launches.

Besides peer-to-peer architecture means that developers and operational specialists not need to spend time to configure and debug avtomatstrom policy or system — the cloud provider is responsible for ensuring sufficient capacity.

### Programming

In server the calculations, the code blocks are subjected to a visual and simple functions for AWS Lambda is a function that accept and create JSON, but can apply to other APIs and JSON can be automatically serialized or deserialized into data structures the choice of the programmer. This means that usually the programmer does not need to worry about multithreading or the direct processing of HTTP requests in the code, which simplifies the task of developing server software.

### Performance

Not frequently used peer-to-peer code may suffer from greater latency of response than code that is continuously running on a dedicated server, a virtual machine or container. And all because, unlike automaticremote, the cloud provider typically "slow" code is completely serverless, while he is idle. That is, when the working medium acts, for example, a working Java environment, if we are talking about the code in Java — requires an impressive amount of time to run, where does the delay in the processing of the query and the next query will be directed to this area code. However, not all code is susceptible to delays of batch processing started via cron, is hardly subjected to such small, infrequent delays.

#### Limited resources

Serverless computing is not suitable for certain computers, for example, for a supercomputer, because of limited resources, the established cloud providers, and also because it's rather cheaper to increase the number of servers required in a particular hour.

### Monitoring and debugging

Troubleshooting peer-to-peer code, performance-related or excessive consumption of resources, is more complex than a traditional server-side code, because although you can calculate the time of entire functions, it is impossible to go deeper and attach profilers, debuggers or APM-tools — and an environment where executable code is not usually in the clear so that its performance characteristics could be accurately replicated in your local environment.

## Sources

Cite error: Invalid <references> tag; parameter "group" is allowed only.

Use <references />, or <references group="..." />