Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Azure Durable Functions
1. State management in Serverless architecture
using Azure Durable functions
Karthikeyan VK
Karthik_3030@yahoo.com
@karthik3030
https://blogs.karthikeyanvk.in
2. Enter Text
Why Durable Functions ?
Manage states in azure functions
Supports Orchestration instead of Choreography.
Handles long running tasks well
https://blogs.karthikeyanvk.in
3. Enter Text
What is Durable Functions ?
Durable Functions is an extension of Azure Functions
and Azure Web Jobs that lets you write stateful
functions in a Serverless environment.
https://blogs.karthikeyanvk.in
4. Enter Text
Where can I use Durable functions ?
They define workflows in code
They can call other functions synchronously and asynchronously.
Output from called functions can be saved to local variables
https://blogs.karthikeyanvk.in
5. Enter Text
What is Serverless Architecture ?
https://blogs.karthikeyanvk.in
No server
dedicated
for a single
application
Third party
services
You don’t
own a
server
Custom
code that is
not ALWAYS
ON
6. Enter Text
What is Azure Functions ?
Azure Functions is a solution for easily running small pieces of
code, or "functions," in the cloud.
You can write just the code you need for the problem at hand,
without worrying about a whole application or the infrastructure
to run it.
https://blogs.karthikeyanvk.in
8. Enter Text
What is State ?
https://blogs.karthikeyanvk.in
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 flipkart mobile app and
when you login into flipkart web app, you can see the product added in
your web app. Now the cart details can be called as “STATE”
9. Enter Text
What is State Management ?
https://blogs.karthikeyanvk.in
State Management is a method of managing state.
Your cart details can be either saved in redis cache or sql
database or Cassandra database.
Adding/retrieving is state management
12. Enter Text
Choreography
https://blogs.karthikeyanvk.in
Choreography employs a decentralized approach for service composition
Choreography is a global description of the participating services, which is
defined by exchange of messages, rules of interaction and agreements
between two or more endpoints.
15. Enter Text
Orchestration Client
The orchestration client binding enables you to write functions
which interact with orchestrator functions.
For example, Client acts on orchestration instances in the
following ways: Start them, Query their status, Terminate them,
Send events to them while they're running.
https://blogs.karthikeyanvk.in
16. Enter Text
Orchestration Functions
Orchestrator functions are the heart of a durable function.
Orchestrator functions describe the way and order actions are
executed
An orchestrator is started by an orchestrator client which could
itself be triggered from any source
https://blogs.karthikeyanvk.in
17. Enter Text
Activity functions
Activity functions are the basic unit of work in a durable orchestration
Activity functions are the functions and tasks being orchestrated in the
process.
For example, you may create a durable function to process an order -
check the inventory, charge the customer, and create a shipment. Each
one of those tasks would be an activity function
https://blogs.karthikeyanvk.in
18. Enter Text
Other Features of Durable functions
Sub-orchestrations
Durable timers
External events
Cross-function app communication
https://blogs.karthikeyanvk.in
19. Enter Text
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.
https://blogs.karthikeyanvk.in
20. Enter Text
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.
https://blogs.karthikeyanvk.in
22. Enter Text
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.
https://blogs.karthikeyanvk.in
24. Enter Text
Pattern #4: Monitoring
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.
https://blogs.karthikeyanvk.in