18. Functions - Things to Remember
Cold start
Execution time limit
Concurrency
Throttling
Quotas
Downstream components
Experimental languages
C# script
Serverless computing is an execution model in which the customer only manages the code, and the vendor manages the allocation of compute resources. It is also known as Functions as a Service, which is actually a better name for it. In Serverless, your code is triggered based on events, and it executes to produce the desired results.
1 In 2.x, all bindings except HTTP, Timer, and Azure Storage must be registered. See Register binding extensions.
2 Experimental — not supported and might be abandoned in the future.
Serverless computing is an execution model in which the customer only manages the code, and the vendor manages the allocation of compute resources. It is also known as Functions as a Service, which is actually a better name for it. In Serverless, your code is triggered based on events, and it executes to produce the desired results.
I only care about milk, and it is so much cheaper, and so much less maintenance!
I don’t know about you, but my code always works!
It’s perfect from the beginningIt needs no testing
It needs no monitoring
I anticipate all the client requests for changes and implement them in version one
Not…
Oh no, we have a problem here!
Fortunately, the problem has already been solved
There is a plethora of great tools out there
When Microsoft came into this market, we were not the first comer, and thus we had the second comer advantage. The first thing we did is go to the developers and ask them what they like and dislike about Serverless
And the #1 response was – developer experience
Function chaining refers to the pattern of executing a sequence of functions in a particular order. Often the output of one function needs to be applied to the input of another function.
Fan-out/fan-in refers to the pattern of executing multiple functions in parallel, and then waiting for all to finish. Often some aggregation work is done on results returned from the functions.
There are 3 more patterns in durable functions:
Async HTTP APIs
Have a long-running action triggered by an HTTP call, and then redirecting the client to a status endpoint that they can poll to learn when the operation completes.
MonitoringUsing Durable Functions, multiple monitors that observe arbitrary endpoints can be created in a few lines of code.
Human interaction
The orchestrator function would use a durable timer to request approval and escalate in case of timeout.