- TechOps Examples
- Posts
- Azure Durable Function Patterns
Azure Durable Function Patterns
TechOps Examples
Hey — It's Govardhana MK 👋
Along with a use case deep dive, we identify the top news, tools, videos, and articles in the TechOps industry.
IN TODAY'S EDITION
🧠 Use Case
Azure Durable Function Patterns
🚀 Top News
Amazon EventBridge announces up to 94% improvement in end-to-end latency for Event Buses
📽️ Videos
A faster way to push git branches
MUST Know Linux File Permissions in 5 Minutes
📚️ Resources
Actionable AWS Security Best Practices [Cheat Sheet]
Bash Script to Install Multiple Helm Charts in One Go
Understanding Docker Network Types: Usage and Use Cases
🧠 USE CASE
Azure Durable Function Patterns
We all know Azure Functions lets you run small bits of code whenever certain events happen, like a timer going off or a message arriving.
It connects easily with other Azure services, so you can automate tasks and build apps without worrying about servers.
A typical Azure functions workflow
What is Azure Durable Functions in that case?
It’s an extension of Azure Functions that lets you manage complex workflows with state.
Basically, it allows your code to wait for things to finish or run tasks in a specific order without writing complex code to track everything.
You can create workflows that need steps like waiting for approval, handling retries, or running multiple things at once and then gathering results.
It’s like giving Azure Functions a memory and some planning skills!
Key Components of Azure Durable Functions
Orchestrator Function: Defines and manages workflow sequence and state.
Activity Functions: Stateless tasks called within the workflow, like data processing.
Client Function: Triggers and monitors workflow status or retrieves results.
Durable Timer: Allows delays, timeouts, and wait periods in workflows.
External Events: Pauses workflow to wait for external triggers or approvals.
Note: You need a Storage account for state management as a pre-requisite.
Let's explore the Azure Durable Functions patterns with a real-world use case of an eCommerce order processing system
Function Chaining pattern is designed to execute a series of functions in a specific sequence where each function waits for the previous one to complete.
This pattern is ideal for processes that rely on the successful completion of prior tasks, as depicted in the image where each function represents a sequential step in the order flow.
Fan-out and Fan-in pattern initiates multiple functions in parallel, ideal for batch operations where each task can be processed independently.
In eCommerce, once an order batch is prepared, it can fan out to multiple "Process Item" functions—each handling a specific item in an order (like packaging or quality checks).
After each item is processed, a fan-in step aggregates the statuses to create an "Order Ready for Shipment" report.
Async HTTP API pattern facilitates long-running operations by using an HTTP endpoint to check the status of the operation asynchronously.
For example, when a customer checks their order status, the system retrieves the latest updates, like "Processing," "In transit," or "Out for Delivery."
Monitoring pattern enables periodic checks on workflows to ensure they are progressing as expected.
For eCommerce orders, a monitoring function might regularly check "Active Shipments." If an order faces delays, the workflow can detect the issue, alert the appropriate team, and send notifications to customers.
Some workflows require human approval or decision-making.
If an order faces an exception, like an item out of stock, the system could send a "Restock Alert" to a human operator. After a set wait time, the operator can decide to "Cancel" the order or "Backorder" the item.
External Events Correlation pattern is used to handle multiple external events that affect a workflow’s state.
Each external event triggers a state update, keeping the order status current, the workflow updates as the order moves through various stages—like "Packed," "Shipped," and "Delivered."
Most of the cloud efficiency is directly related to design decisions.
I hope this was helpful in making better Azure Functions design decisions.
You may even like:
Writer RAG tool: build production-ready RAG apps in minutes
RAG in just a few lines of code? We’ve launched a predefined RAG tool on our developer platform, making it easy to bring your data into a Knowledge Graph and interact with it with AI. With a single API call, writer LLMs will intelligently call the RAG tool to chat with your data.
Integrated into Writer’s full-stack platform, it eliminates the need for complex vendor RAG setups, making it quick to build scalable, highly accurate AI workflows just by passing a graph ID of your data as a parameter to your RAG tool.