Why Integration Patterns?
Modern applications are often distributed and modular, meaning different services must exchange data reliably and at scale. Azure provides multiple services (Service Bus, Event Grid, Event Hubs, APIM) — but the real skill is knowing which integration pattern to apply. The AZ-305 exam frequently tests whether you can map a scenario to the right pattern.
1. Publish/Subscribe Pattern
Definition:
A message is published once but delivered to many subscribers.
Azure Services:
-
Service Bus Topics → enterprise-grade, ordered, durable.
-
Event Grid → lightweight, push model for serverless.
Use Cases:
-
New customer signup → notify billing, CRM, and email system.
-
IoT events triggering multiple downstream systems.
Exam Tip: If requirement says “fan out to multiple systems reliably” → Service Bus Topics.
2. Fan-Out Pattern
Definition:
A single message/event triggers parallel processing in multiple systems.
Azure Services:
-
Event Grid → lightweight event delivery.
-
Logic Apps / Functions → handle parallel workflows.
Use Cases:
-
Blob upload → trigger resize, virus scan, logging simultaneously.
Exam Tip: If requirement says “event must trigger multiple independent workflows” → Event Grid fan-out.
3. Request/Reply Pattern
Definition:
Synchronous communication — client sends request and expects a response.
Azure Services:
-
API Management → secure synchronous calls.
-
Functions / App Services → implement APIs.
-
Service Bus (with correlation ID) → async request/reply.
Use Cases:
-
Payment authorization (must confirm before order continues).
-
Microservices needing synchronous responses.
Exam Tip: If requirement says “real-time confirmation needed” → APIM / direct API call, not Event Grid.
4. Decoupling Pattern
Definition:
Separates producers from consumers to avoid dependency failures.
Azure Services:
-
Service Bus Queues → reliable async decoupling.
-
Storage Queues → simple, cost-effective.
-
Event Hubs → large-scale telemetry decoupling.
Use Cases:
-
E-commerce orders queued for backend processing.
-
Decouple web front-end from payment service.
Exam Tip: If requirement says “ensure front-end stays responsive even if backend is down” → Service Bus Queue.
5. Best Practices for Integration
-
Choose Service Bus for enterprise-grade messaging with transactions.
-
Use Event Grid for lightweight event-driven workflows.
-
Use Event Hubs for high-volume telemetry ingestion.
-
Expose APIs securely with API Management.
-
Always plan for dead-letter handling in messaging systems.
-
Apply retry logic + exponential backoff in consumers.
-
Use idempotent processing → handle duplicate messages safely.
Example Enterprise Scenario
A logistics company requires:
-
Order events must be processed by billing, warehouse, and delivery teams.
-
Each order must also be logged asynchronously without slowing down the main system.
-
The mobile app requires real-time API responses for order status.
Correct design:
-
Use Service Bus Topics for order events → fan-out to billing, warehouse, delivery.
-
Use Event Grid for async logging pipeline.
-
Expose real-time order status API via API Management.
Confusion Buster
-
Fan-Out vs Pub/Sub
-
Pub/Sub = messaging pattern (producer → multiple consumers).
-
Fan-Out = execution pattern (one event triggers multiple workflows).
-
-
Service Bus Topics vs Event Grid
-
Topics = reliable, transactional, ordered.
-
Event Grid = lightweight, fire-and-forget, near real time.
-
-
Request/Reply vs Async Messaging
-
Request/Reply = synchronous (real-time response).
-
Async Messaging = decoupled, eventual processing.
-
Exam Tips
-
“Which integration pattern ensures a front-end app is decoupled from backend failures?” → Queue decoupling.
-
“Which service provides fan-out for blob upload triggers?” → Event Grid.
-
“Which pattern requires synchronous real-time confirmation?” → Request/Reply with APIM.
-
“Which service ensures multiple departments process the same order reliably?” → Service Bus Topics.
What to Expect in the Exam
-
Direct Q: “Which Azure service best supports publish/subscribe messaging with filters?” → Service Bus Topics.
-
Scenario Q: “Retailer must notify multiple systems when a customer registers.” → Pub/Sub with Service Bus Topics or Event Grid.
-
Scenario Q: “Image upload must trigger multiple workflows (resize, virus scan, log).” → Event Grid fan-out.
-
Scenario Q: “Mobile app must confirm payment instantly.” → Request/Reply via API Management.
-
Trick Q: “Event Grid provides transactional ordering with duplicate detection.” → False (that’s Service Bus).