1. Architect your cloud application to
save cost up to 90% using azure
functions
Karthikeyan VK
Web Architect
Twitter: @Karthik3030
Blogs.karthikeyanvk.in
2. Why Azure functions ?
No server needed
dedicated for a
single application
You don’t own a
server
Scale on demand
Pay per use
pricing model
Supports various
languages.
3. What is Azure functions ?
Azure Functions is a solution for easily running
small pieces of code, or "functions," in the cloud.
4. Types of Azure functions
Timer Trigger
Http Trigger
Queue/Blob Trigger
Web Hooks
5. Functions Plan
Consumption plan - When your function runs, Azure provides all of the necessary
computational resources. You don't have to worry about resource management, and you only
pay for the time that your code runs.
App Service plan - Run your functions just like your web, mobile, and API apps. When you
are already using App Service for your other applications, you can run your functions on the
same plan at no additional cost.
6. Web App
Pay before use
Always on, so no initial time lag
Minimum cost 35 dollars*
Extra cost for auto scaling
Azure functions
Pay per use
Slow Start-up
1 million requests and 400,000 GB-s
of resource consumption per month
Scale on demand
11. What is state ?
The state is all of the information that is retained by your
program, often with respect to previous events or
interactions.
For example, If you add a product to the cart in Amazon using
mobile app and when you login into amazon web app, you can
see the product added in your web app. Now the cart details
is the one of the state of amazon application
13. Why Durable Functions ?
Azure functions are stateless, to manage
states in azure functions. You need Durable
functions
Long running functions can be architected to
run on Durable functions
14. Why Durable Functions ?
You can define workflows in code.
They can call other functions synchronously and
asynchronously. Output from called functions can
be saved to local variables
16. Patterns in Azure durable functions
Function Chaining
Fan in/Fan out
Async Http API
Monitoring
Human Interaction
17. Pattern #1: Function chaining
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.
18. Pattern #2: Fan-out/fan-in
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.
19. Pattern #3: Async HTTP APIs
A common way to implement this pattern is by having the 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.
20. Pattern #4: Monitoring
The monitor pattern refers to a flexible recurring process in a workflow
Instead of exposing an endpoint for an external client to monitor a long-
running operation, the long-running monitor consumes an external endpoint,
waiting for some state change.
21. Pattern #5: Human interaction
Involving humans in an automated process is tricky because people aren't as
highly available and as responsive as cloud services.
24. Draw backs of Standard Azure functions
In consumption mode, the azure functions has
cold start
You cannot define the CPU type of your
running process
Functions can make development even more productive, and you can use your development language of choice, such as C#, F#, Node.js, Java, or PHP
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud.
Functions can make development even more productive, and you can use your development language of choice, such as C#, F#, Node.js, Java, or PHP
* - Free and shared available but it is not always on and it has very less configuration relatively to your laptop in CPU and memory.