/software-architecture:architecture-patternsfrom software-architecture
Reference for software architecture patterns with Azure implementations covering compute, communication, data, resilience, security, and AI/ML patterns. Use when choosing Azure services or architectural strategies.
Ships in software-architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pattern choice should follow the problem, not the technology. The Azure Well-Architected Framework's own guidance: "Choose a pattern based on the problem you need to solve, not the technology you want to use."
The highest-leverage decisions are the irreversible ones: Cosmos DB partition key, event schema/versioning strategy, multi-tenancy isolation model, and secrets architecture. Get these wrong and remediation is a re-platform, not a config change.
App Service (modular monolith)
→ Azure Container Apps (serverless containers — simpler default for most containerized workloads)
→ AKS (full Kubernetes only when you need the API, operators, mesh, or fine-grained node control)
Azure Functions Flex Consumption fills the event-driven serverless tier.
When to use: Startup stage, small teams, domain not yet well understood.
Azure mapping:
Production gotchas:
applicationInitialization warm-up pathsDecision trigger: Stay monolithic until you have measurable deployment contention between teams or a clearly independent scaling/availability requirement for a subsystem.
Azure mapping:
AKS Istio add-on constraints:
EnvoyFilter, WasmPlugin, IstioOperator, and several other CRDsProduction gotchas:
Decision trigger: Independent deployability or scaling of a subsystem is a hard requirement, and you have the platform/observability maturity to pay the distributed-systems tax.
Azure Functions plans:
| Plan | Notes |
|---|---|
| Flex Consumption (Recommended, GA Dec 2024) | VNet integration at no extra cost, instance memory selection (512/2048/4096 MB), per-instance concurrency scaling, "Always Ready" to eliminate cold starts, configurable max instances (min 40, max 1,000, default 100), Hyper-V isolation |
| Consumption | Legacy |
| Premium | Higher cost, pre-warmed |
| Dedicated | Always-on App Service Plan |
Critical Flex Consumption constraints:
Retirements to schedule:
Durable Functions patterns:
ContinueAsNew)WaitForExternalEvent + a durable timer for timeout/escalationDateTime.Now/Date.now(), random, or direct I/O inside an orchestrator; use context.CurrentUtcDateTime and delegate I/O to activitiesDecision trigger: Spiky/bursty or event-driven workloads where idle cost matters; choose Flex Consumption unless you need a feature only on another plan.
| Service | Job | Key Features |
|---|---|---|
| Service Bus | Enterprise queues/topics | Ordering (sessions), transactions, DLQ, scheduled messages, duplicate detection |
| Event Grid | Reactive pub/sub | MQTT v3.1.1/v5.0 broker (Namespaces), HTTP pull delivery, 24hr retry with exponential backoff |
| Event Hubs | High-throughput streaming | Kafka-compatible endpoint, consumer groups, Capture to ADLS/Blob |
Most real EDA architectures use all three: Event Hubs for ingestion, Service Bus for reliable work queues, Event Grid for reactive system events.
Event Grid Namespaces note: Standard tier and classic topics (Basic) are different resource models — Namespaces currently support Event Hubs as the only push destination for namespace topics.
MQTT scale: A single Event Grid namespace (40 throughput units) demonstrated 200,000 publishers + 200,000 subscribers at ~40,000 messages/second.
Anti-pattern: Using events for request/response where the caller needs an immediate consistent answer.
Solves the dual-write problem: write the business change and the outbox event in one local transaction, then relay to the broker. Required whenever you publish events from a write DB.
Azure services:
Production gotchas:
The partition key is the single most critical and irreversible decision. A poor partition key (low cardinality or skewed access) creates hot partitions that throttle (429s) regardless of provisioned RUs — and you cannot change a container's partition key in place; you must migrate.
Caching patterns:
| Pattern | How It Works | Use When |
|---|---|---|
| Cache-aside (lazy loading) | App checks cache, loads on miss, populates | Most common default |
| Write-through | Write cache + DB together | Need consistency, can accept write latency |
| Write-behind | Write cache, async flush | Need write speed, can tolerate durability risk |
| Read-through | Cache fetches transparently | Simplify app code |
| Refresh-ahead | Proactively refresh before expiry | Predictable access patterns |
Thundering herd / cache stampede: Mitigate with probabilistic early expiration or a mutex on cache rebuild.
Full Azure menu:
| Service | Algorithm | Notes |
|---|---|---|
| Azure AI Search | Hybrid BM25+vector+semantic reranker | Full retrieval stack; vector_semantic_hybrid is Microsoft's recommended default |
| Cosmos DB for NoSQL | DiskANN (GA) | Sub-20ms at scale; requires ≥1,000 vectors or falls back to full scan |
| PostgreSQL Flexible Server + pgvector | HNSW | Familiar SQL interface |
| Azure SQL Database | Native VECTOR type + VECTOR_DISTANCE (GA June 2025); DiskANN indexes (preview) | Co-locate with operational data |
| Azure Cache for Redis (Enterprise) | RediSearch vector | Ultra-low latency |
Decision: Full retrieval stack → AI Search. Data already in Cosmos/SQL, want no extra system → built-in vector search. Pure billion-scale vector workload → dedicated vector DB may be cheaper.
Never store secrets in config files, baked images, or source control.
Azure Key Vault (Standard = software-protected; Premium = HSM-backed)
@Microsoft.KeyVault(...)Azure Managed HSM: dedicated, FIPS 140-2 Level 3, single-tenant.
HashiCorp Vault on Azure: beats Key Vault for true dynamic secrets (short-lived, on-demand), multi-cloud, or Vault Agent sidecar injection.
Injection patterns: Startup pull, sidecar injection (Vault Agent / Dapr), or CSI driver mount (AKS preferred).
Tiers: Consumption / Basic / Standard / Premium / Developer (plus v2 tiers)
APIM AI Gateway capabilities:
azure-openai-token-limit: TPM enforcementazure-openai-emit-token-metric: usage to App Insights split by subscription/IP/custom dimensionazure-openai-semantic-cache-store/lookup using Azure Managed Redis + RediSearch + an embeddings modelSemantic caching gotcha: Silently no-ops if the external Redis cache lacks RediSearch or isn't wired as an APIM external cache. Set similarity threshold carefully: too loose returns wrong cached answers.
| Service | Layer | Scope | Use When |
|---|---|---|---|
| Azure Load Balancer | L4 | Regional | VMs/VMSS |
| Application Gateway v2 | L7 | Regional | WAF, TLS termination, URL/path routing, cookie affinity; AKS ingress via AGIC |
| Azure Front Door | L7 + CDN | Global | HTTP(S) with CDN, WAF, geo-routing, caching — now the unified Azure CDN/edge platform |
| Traffic Manager | DNS | Global | DNS-based routing (performance/priority/weighted/geographic) |
CDN retirements:
| Pattern | Purpose | Azure Implementation |
|---|---|---|
| Retry with exponential backoff + jitter | Handle transient failures | Polly (.NET), Tenacity (Python) |
| Circuit Breaker (Closed/Open/Half-Open) | Stop calling a failing dependency | Polly; APIM backend circuit breaker |
| Bulkhead | Isolate resource pools | Thread pool isolation; ACA scale units |
| Timeout | Fail fast | Set at every network hop |
| Fallback | Graceful degradation | Return cached data, default response |
| Health Endpoint Monitoring | /health/live, /health/ready | App Service health check; AKS probes |
| Idempotency | Safe retry of mutations | Idempotency keys on write endpoints |
| Saga | Distributed transactions | Choreography vs orchestration; compensating transactions; Durable Functions |
| Outbox | Transactional event publishing | Write business change + outbox in one local transaction, relay to broker |
| Queue-Based Load Leveling | Smooth bursty load | Service Bus + Competing Consumers |
WAF-recommended pairings:
RTO/RPO drives architecture:
Azure services:
Service Bus geo features (mutually exclusive on same namespace):
Critical sizing gotcha: Redundancy is architecture; resiliency is behavior. Two zones behind a LB but Zone B sized for 50% load — Zone A fails, B is overwhelmed, the whole service degrades. Size failover capacity for full load.
Chaos engineering: Azure Chaos Studio.
Feature flag types:
| Type | Purpose |
|---|---|
| Release toggles | Decouple deploy from release — the CI/CD enabler |
| Experiment toggles | A/B testing; progressive rollout (10%→50%→100%) |
| Ops toggles | Kill switches |
| Permission toggles | By user segment or tier |
Manage flag lifecycle/hygiene as technical debt. Third-party options: LaunchDarkly (Marketplace ISV), Unleash on AKS.
Isolation models:
| Model | Isolation | Cost | Complexity |
|---|---|---|---|
| Silo | Isolated resources per tenant | Highest | Lowest |
| Pool | Shared resources, tenant-ID-keyed | Lowest | Highest |
| Bridge (Hybrid) | Shared for small, isolated for large/premium | Medium | Medium |
Azure implementations:
Critical gotcha: Pool model with tenant-ID partition key in Cosmos DB risks a hot partition when one large tenant dominates — same irreversible partition-key trap, now with cross-tenant blast radius. Consider a composite key or bridge model for "whale" tenants.
OpenTelemetry (OTel) is the unifying standard (collector, SDK, semantic conventions).
Production gotcha: Incomplete distributed traces usually come from inconsistent sampling across nodes — if one service applies head-based sampling without propagating the decision via W3C headers, downstream spans get dropped. In Azure Functions, don't run the Azure Monitor distro in the isolated worker if the host already instruments — duplicate telemetry.
"Never trust, always verify; assume breach; least privilege."
Azure reference stack: Entra ID + Conditional Access + PIM (just-in-time privileged access) + Defender for Cloud + Private Endpoints + Azure Firewall.
| Flow | Use When |
|---|---|
| Authorization Code + PKCE | Web/native apps with user interaction |
| Client Credentials | Machine-to-machine (M2M) |
| Device Code | Devices with no browser |
Per Microsoft's own benchmarking: hybrid search (BM25 keyword + vector via RRF) plus a transformer-based semantic ranker is "the most effective retrieval engine for most scenarios."
k/maxTextRecallSize to sum ≥50 to give the reranker a full input setMicrosoft's recommended RAG combination: Retrieval + Groundedness + Relevance + Content Safety
Available evaluators: Retrieval, Document Retrieval, Groundedness, Groundedness Pro, Relevance, Response Completeness, Coherence, Fluency, QA, Intent Resolution, Tool Call Accuracy, Task Adherence, risk/safety, textual-similarity (BLEU/ROUGE/METEOR/GLEU/F1).
Note: RAGAS is not a native Foundry evaluator — RAGAS integration in the Microsoft ecosystem is via MLflow on Azure Databricks.
azure-openai-token-limit: TPM enforcementazure-openai-emit-token-metric: usage to App InsightsUseOpenTelemetry() built inHost agent loops on ACA or AKS. Durable Functions can host deterministic, fault-tolerant agent orchestrations that survive restarts and pause for human input at zero compute cost.
Prompt Flow retires April 20, 2027 — no longer recommended for new development. Migrate to Microsoft Agent Framework before the date; runtime container images no longer receive updates.
Key patterns implemented in Azure:
| Service | Best For |
|---|---|
| Durable Functions | Code-first, fault-tolerant, stateful workflows; human-approval; agent loops |
| Logic Apps | GUI-based + 1,400+ connectors; enterprise integration |
| ADF / Fabric Pipelines | Data workflows |
| Copilot Studio | Conversational/agentic workflows |
ACA KEDA gotcha: Scale-to-zero with Service Bus can scale down prematurely when messages process faster than the polling interval — lower pollingInterval or set minReplicas: 1 for steady low-frequency traffic. KEDA's default cooldown is 300s.
AKS node pool types: Azure CNI (standard), Azure CNI Overlay (scalable), Azure CNI Powered by Cilium (note: incompatible with Istio add-on).
Systems mirror team communication structure. The Inverse Conway Maneuver designs team structure to produce the desired architecture. Team Topologies: stream-aligned, platform, enabling, complicated-subsystem teams.
Stage 1 — Start simple.
Stage 2 — Decompose deliberately.
Stage 3 — Scale and harden.
Stage 4 — Add AI-native capability.
vector_semantic_hybrid) + Azure OpenAI; co-locate vectors in Cosmos DB/Azure SQL to avoid a separate service| Migration | Deadline |
|---|---|
| Front Door classic → Standard/Premium | March 31, 2027 |
| Azure CDN classic → Front Door | September 30, 2027 |
| AzureML SDK v1 → v2 | June 30, 2026 |
| Linux Consumption Functions → Flex Consumption | September 30, 2028 |
| In-process .NET Functions model → isolated | November 2026 |
| Semantic Kernel / AutoGen → Microsoft Agent Framework | Before GA (end Q1 2026) |
| Prompt Flow → Microsoft Agent Framework | Before April 20, 2027 |
| Analytics → Microsoft Fabric / OneLake (medallion) | Ongoing |
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/software-architectureProduction software architecture reference for Python (FastAPI), Next.js/TypeScript, and Azure at scale. Covers when to use modular monolith vs microservices, API style selection (tRPC/REST/GraphQL/gRPC), Python backend layered architecture with FastAPI + SQLAlchemy + dependency injection, Next.js App Router with Server Components and state management, Azure landing zones and hub-and-spoke networking, zero-downtime migrations with expand-contract, observability with OpenTelemetry, Conway's Law team alignment, and ADRs. Use when advising on architecture decisions, stack selection, migration strategy, or scaling approaches for Python/TypeScript/Azure systems./software-designAdvanced software design practitioner guide: design-as-decision-making, just-enough design, monolith-first doctrine, SOLID/DRY/KISS/YAGNI as contextual heuristics, ADRs, C4 model, fitness functions/ArchUnit, architecture advice process, design process by scale, DDD strategic/tactical patterns, AI impact on maintainability (GitClear 2024), bounded contexts, event storming, design docs/RFCs, and evolutionary architecture governance.Other plugins' skills for the same job
npx claudepluginhub the-vibey-project/vibey --plugin software-architecture2 plugins ship this exact skill · first indexed Aug 12, 2026