Application Architecture Design
AZ-305 AZ-305 · Design infrastructure solutions
Modern applications are systems of cooperating services, and the architecture between them determines whether the system is resilient or fragile. This guide covers the messaging, eventing, API, caching, configuration, and deployment services that AZ-305 expects you to design with — and the patterns that make them work together.
Messaging: Service Bus vs Queue Storage
Azure Service Bus is the enterprise message broker: queues and topics with publish-subscribe, message ordering (sessions), duplicate detection, transactions, dead-lettering, and scheduled delivery. Choose it when messages must not be lost, ordering matters, or multiple subscribers need the same message. Azure Queue Storage is the simple, cheap queue: large message volumes with basic at-least-once delivery and no ordering guarantees. Choose it for simple decoupling at massive scale where occasional duplicates are acceptable. The exam distinction: enterprise messaging features (ordering, transactions, topics) mean Service Bus; simple, high-volume, low-cost queuing means Queue Storage. Both support the competing consumers pattern (multiple workers pulling from one queue) and the dead-letter queue pattern (poison messages moved aside after repeated failures instead of blocking the queue).
Event-driven architecture: Event Grid
Azure Event Grid routes discrete events from sources (Blob Storage, Event Hubs, custom applications) to handlers (Functions, Logic Apps, webhooks). It is the backbone of event-driven architecture: services react to events rather than polling or calling each other directly, which decouples them and improves resilience. Event Grid offers near-real-time delivery with at-least-once semantics, filtering (route only events matching a subject or value), and dead-lettering for undeliverable events. Compare with Service Bus: Event Grid is for reactive notifications ("something happened"), Service Bus is for reliable command and event messaging with ordering and transactions. A common pattern combines them: Event Grid notifies that a file arrived; Service Bus carries the processing command with guaranteed delivery.
API integration: API Management
Azure API Management (APIM) sits in front of APIs as a gateway: it provides a single entry point, authentication and authorisation (including Entra ID and subscription keys), rate limiting and quotas, request/response transformation, caching, and a developer portal with documentation. The tiers matter: Consumption (serverless, pay-per-call, no VNet support), Developer (non-production), Basic/Standard (production, no multi-region), Premium (multi-region, VNet injection, availability zones). For internal APIs, deploy APIM in internal mode inside a VNet so APIs are never exposed publicly. APIM also supports API versioning (revisions and versions let you evolve APIs without breaking clients) and policies (XML-based rules for transformation, validation, and backend routing). In exam scenarios, "expose internal APIs to partners securely with rate limiting" is APIM; "connect applications with enterprise messaging" is Service Bus.
Caching: Azure Cache for Redis
Azure Cache for Redis provides in-memory caching to reduce database load and latency. The patterns matter more than the product: cache-aside (the application checks the cache, loads from the database on a miss, and populates the cache) is the standard pattern; write-through writes to the cache and the database together. Choose the tier by need: Basic (single node, dev/test), Standard (replicated, production), Premium (clustering, persistence, VNet, zone redundancy), Enterprise (Redis modules like search and JSON, active geo-replication). For active geo-replication across regions, Enterprise tier with active geo-replication keeps caches in sync. Eviction policies control what happens when memory fills — choose allkeys-lru for a general cache. The exam trap: caching improves read performance but adds consistency complexity; cache data that is read often and changes rarely, and set TTLs so stale data expires.
Configuration: App Configuration
Azure App Configuration centralises application settings and feature flags: key-value settings with labels per environment, point-in-time snapshots, and feature management (gradual rollouts, targeted audiences). It complements Key Vault: App Configuration holds non-secret settings, Key Vault holds secrets — and App Configuration can reference Key Vault secrets by URI, so applications fetch both from one place. Feature flags let you deploy code dark and enable it gradually, which is the deployment-safety answer in many exam scenarios.
Automated deployment: CI/CD
Azure DevOps and GitHub Actions provide CI/CD pipelines: build, test, and deploy with approval gates, environment promotion, and infrastructure as code (Bicep or Terraform). Design points: use deployment slots for zero-downtime releases (covered in the compute guide); use infrastructure as code so environments are reproducible; use approval gates for production deployments; and use canary or blue-green strategies for risky releases. Azure Deployment Environments and Azure Container Registry Tasks automate environment provisioning and container builds. The exam tests CI/CD as a design concern: "deployments must be automated, tested, and reversible" points to pipelines with gates and slots.
Resilience patterns for distributed applications
Distributed applications fail in distributed ways, and AZ-305 expects you to design for it. Retry with exponential backoff and jitter handles transient failures (network blips, throttling) without overwhelming the failing service — but retries must be idempotent, so a retried operation does not duplicate its effect. The circuit breaker pattern stops calling a failing dependency after a threshold, failing fast instead of waiting for timeouts, and periodically testing whether the dependency has recovered. The bulkhead pattern isolates resources (separate connection pools, separate thread pools) so one failing dependency cannot exhaust everything. The timeout pattern bounds every call so a hung dependency cannot hang the caller. The outbox pattern solves the dual-write problem: when an application must update a database and publish an event atomically, it writes the event to an outbox table in the same transaction and a separate process publishes it — guaranteeing the event is never lost. These patterns are the difference between an application that degrades gracefully and one that cascades into a full outage, and the exam rewards candidates who recognise them in scenario questions.
API versioning and lifecycle
APIs evolve, and breaking existing clients is one of the fastest ways to lose trust. API Management supports versions (distinct, coexisting API versions such as v1 and v2, each with its own URL path, header, or query parameter) and revisions (non-breaking changes to an existing version, such as documentation fixes). The design rule is to version from day one: even if only v1 exists, the versioning scheme lets you introduce v2 later without breaking v1 clients. Use revisions for safe changes and versions for breaking changes, and publish a deprecation policy so consumers know when old versions will be retired. Policies in APIM can transform requests between versions (for example, mapping a v1 request shape to a v2 backend), letting you evolve the backend while keeping the public contract stable. In exam scenarios, "add a new API version without breaking existing clients" is the APIM versioning answer, and it pairs naturally with deployment slots for safe backend rollouts.
Exam traps to watch for
- Choosing Queue Storage when the scenario needs ordering, transactions, or publish-subscribe — those are Service Bus features.
- Confusing Event Grid with Service Bus — Event Grid routes discrete event notifications; Service Bus provides reliable messaging with ordering and transactions.
- Caching everything — cache read-heavy, rarely changing data with TTLs; caching volatile data creates stale-read bugs.
- Storing secrets in App Configuration — it holds non-secret settings; secrets belong in Key Vault (referenced by URI).
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.An order-processing system must guarantee that messages are processed in order, never lost, and delivered to both the billing and shipping services. Which messaging service should the architect recommend?
Explanation: Service Bus topics with subscriptions deliver each message to multiple subscribers, and sessions provide ordered, exactly-once-style processing with dead-lettering — matching all three requirements. Option A is wrong because Queue Storage has no ordering guarantees or publish-subscribe. Option C is wrong because Event Grid is for event notifications, not ordered reliable messaging. Option D is wrong because Event Hubs is a telemetry streaming service, not an enterprise message broker.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q2.A company wants to expose internal APIs to external partners with authentication, rate limiting, and usage quotas, plus a self-service developer portal. Which service should the architect recommend?
Explanation: API Management is the API gateway: authentication, rate limiting, quotas, transformation, and a developer portal are its core features. Option A is wrong because Front Door is a global load balancer and CDN, not an API gateway. Option D is wrong because Application Gateway is a layer-7 load balancer with WAF, not an API management platform. Option B is wrong because Service Bus is messaging, not API exposure.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q3.A web application's database is overloaded by repeated reads of product catalog data that changes only a few times a day. What should the architect recommend?
Explanation: Caching read-heavy, rarely changing data in Redis with cache-aside removes most read load from the database, and a TTL ensures stale data expires when the catalog changes. Option A is wrong because scaling the database treats the symptom at higher cost. Option C is wrong because read scale-out helps but still hits the database for every read. Option D is wrong because Blob Storage is object storage without the query and latency characteristics needed for catalog reads.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q4.A company wants to deploy a new feature to 10 percent of users first, then gradually roll it out, with the ability to disable it instantly without redeploying. What should the architect recommend?
Explanation: Feature flags in App Configuration enable percentage-based rollouts and instant disable without redeployment — exactly the requirement. Option C is wrong because slots swap all traffic at once, not a percentage. Option A is wrong because Traffic Manager routes between endpoints; it cannot toggle a feature within the application. Option D is wrong because a separate plan is an infrastructure split, not a feature rollout mechanism.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q5.A message queue is blocked because one malformed message keeps failing and being retried forever. What pattern should the architect recommend?
Explanation: A dead-letter queue moves poison messages aside after a configured number of failed deliveries, unblocking the queue while preserving the message for investigation. Option B is wrong because lock duration controls how long a message is hidden during processing, not poison-message handling. Option C is wrong because queue size does not address a stuck message. Option A is wrong because duplicate detection prevents duplicate messages, not repeated failures.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q6.A company runs APIs in two regions and needs API Management deployed in both regions with traffic served locally in each. Which API Management tier should the architect recommend?
Explanation: Only the Premium tier supports multi-region deployment, along with VNet injection and availability zones. Option A is wrong because Consumption is serverless and single-region with no VNet support. Option C is wrong because Developer is a non-production tier. Option D is wrong because Basic is single-region.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q7.An application stores its configuration in code and requires a redeployment to change any setting. The team wants centralised settings per environment, with secrets stored securely. What should the architect recommend?
Explanation: App Configuration centralises non-secret settings with labels per environment, and Key Vault references let it serve secrets securely without storing them — the correct separation. Option A is wrong because secrets should not be stored in App Configuration. Option C is wrong because Blob Storage lacks versioning, labels, and feature flags for configuration. Option D is wrong because settings in source code require redeployment and risk exposing secrets.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q8.A retail company needs to process millions of simple queue messages per day at the lowest possible cost. Message ordering does not matter and occasional duplicates are acceptable. Which service should the architect recommend?
Explanation: Queue Storage is the simple, cheap queue for high-volume messaging where ordering and exactly-once guarantees are not required — the lowest-cost fit. Option B is wrong because Service Bus Premium is the most expensive tier and its enterprise features are unnecessary here. Option D is wrong because Event Hubs Dedicated is a streaming platform, not a simple queue, and is far more expensive. Option A is wrong because API Management is an API gateway, not a queue.
Exam objective: AZ-305 Domain 4: Design an application architecture
Q9.A company wants production deployments to require manual approval, run automated tests, and be reversible. Which CI/CD design should the architect recommend?
Explanation: A pipeline with automated tests, an approval gate, and deployment slots delivers all three requirements: automation, human approval, and instant rollback via slot swap. Option D is wrong because manual deployments are unrepeatable and unaudited. Option B is wrong because it has no approval gate or rollback mechanism. Option C is wrong because FTP uploads are manual, untested, and irreversible.
Exam objective: AZ-305 Domain 4: Design an application architecture