cloud-platform-skills / skills
Cursor rule1 starsChanged 3 months agoMITView on GitHub
Scalability and high availability: multi-AZ and active-active topology, global load balancing and failover, HPA and KEDA autoscaling on custom or queue-depth metrics, circuit breakers, bulkheads, retries with jitter, and rate limiting. Use when a service must survive an availability zone failure, when it collapses under traffic spikes and drags downstream services with it, or when CPU is the wrong autoscaling signal.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,531 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/rules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-index.mdcCursor rule
- .cursor/rules/skills/ai-agent-security-llm-threats.mdcCursor rule
- .cursor/rules/skills/api-gateway-service-mesh.mdcCursor rule
- .cursor/rules/skills/aws-cloud-migration-strategies.mdcCursor rule
- .cursor/rules/skills/aws-eks-enterprise-patterns.mdcCursor rule
- .cursor/rules/skills/aws-iam-zero-trust-policies.mdcCursor rule
- .cursor/rules/skills/azure-aks-enterprise-landing-zones.mdcCursor rule
- .cursor/rules/skills/azure-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/backup-and-disaster-recovery.mdcCursor rule
- .cursor/rules/skills/chaos-engineering-resilience-testing.mdcCursor rule
- .cursor/rules/skills/cicd-pipeline-design.mdcCursor rule
- .cursor/rules/skills/cloud-native-microservices-patterns.mdcCursor rule
- .cursor/rules/skills/cloud-security-posture-cspm-cis.mdcCursor rule
- .cursor/rules/skills/configuration-management-ansible.mdcCursor rule
- .cursor/rules/skills/container-runtime-security-falco.mdcCursor rule
- .cursor/rules/skills/database-devops-lifecycle.mdcCursor rule
- .cursor/rules/skills/detection-engineering-threat-hunting.mdcCursor rule
- .cursor/rules/skills/devops-metrics-dora-kpis.mdcCursor rule
- .cursor/rules/skills/docker-containerization-basics.mdcCursor rule
- .cursor/rules/skills/enterprise-iac-governance-terragrunt.mdcCursor rule
- .cursor/rules/skills/finops-framework-inform-optimize-operate.mdcCursor rule
- .cursor/rules/skills/gcp-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/gcp-gke-autopilot-multi-tenant.mdcCursor rule
- .cursor/rules/skills/git-branching-merge-strategies.mdcCursor rule
- .cursor/rules/skills/gitops-multi-cluster-argo-flux.mdcCursor rule
- .cursor/rules/skills/helm-kubernetes-deployment.mdcCursor rule
- .cursor/rules/skills/incident-management-and-postmortem.mdcCursor rule
- .cursor/rules/skills/infrastructure-host-monitoring.mdcCursor rule
- .cursor/rules/skills/internal-developer-portal-backstage.mdcCursor rule
- .cursor/rules/skills/linux-sysadmin-troubleshooting.mdcCursor rule
- .cursor/rules/skills/performance-load-testing.mdcCursor rule
- .cursor/rules/skills/policy-as-code-opa-kyverno.mdcCursor rule
- .cursor/rules/skills/prometheus-grafana-otel-tracing.mdcCursor rule
- .cursor/rules/skills/scripting-and-automation.mdcCursor rule
- .cursor/rules/skills/secops-incident-triage-forensics.mdcCursor rule
- .cursor/rules/skills/secrets-management-vault-kms.mdcCursor rule
- .cursor/rules/skills/serverless-event-driven-architecture.mdcCursor rule
- .cursor/rules/skills/shift-left-security-sast-sca.mdcCursor rule
- .cursor/rules/skills/sli-slo-error-budget-design.mdcCursor rule
- .cursor/rules/skills/supply-chain-security-slsa-sigstore.mdcCursor rule
- .cursor/rules/skills/terraform-iac-modules.mdcCursor rule
- .cursor/rules/skills/write-a-skill.mdcCursor rule
- .cursor/rules/skills/zero-downtime-release-strategies.mdcCursor rule
- ai-agent-security-llm-threatsSkill
- api-gateway-service-meshSkill
- aws-cloud-migration-strategiesSkill
- aws-eks-enterprise-patternsSkill
- aws-iam-zero-trust-policiesSkill
- azure-aks-enterprise-landing-zonesSkill
- azure-cloud-engineering-patternsSkill
- backup-and-disaster-recoverySkill
- chaos-engineering-resilience-testingSkill
- cicd-pipeline-designSkill
- cloud-native-microservices-patternsSkill
- cloud-security-posture-cspm-cisSkill
- configuration-management-ansibleSkill
- The first 60 shown.
The file
We split this scalability-high-availability-patterns.mdc into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 93
Do: Always distribute computing across a minimum of 3 Availability Zones (AZs) per region.
- Distinctive: line 94
Do: Use exponential backoff with jitter on all downstream API retries to prevent thundering herd crashes.
- Very specific: line 95
Don't: Never scale down immediately without a stabilization window (stabilizationWindowSeconds: 300).
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Scalability and high availability: multi-AZ and active-active topology, global load balancing and failover, HPA and KEDA autoscaling on custom or queue-depth metrics, circuit breakers, bulkheads, retries with jitter, and rate limiting. Use when a service must survive an availability zone failure, when it collapses under traffic spikes and drags downstream services with it, or when CPU is the wrong autoscaling signal."
globs:
alwaysApply: false
---
# Scalability & High Availability (HA) Architecture Patterns
## When to Use This Skill
**Triggers — load this skill when:**
- A design must survive AZ or region loss without manual intervention
- Autoscaling on custom or event-driven metrics needs configuring
- Overload protection (circuit breaker, bulkhead, rate limit, backpressure) is missing
**Route elsewhere when:**
- Recovery from catastrophic loss -> `backup-and-disaster-recovery`
- Measuring headroom empirically -> `performance-load-testing`
- Mesh-level resilience policy -> `api-gateway-service-mesh`
## 1. High Availability Architecture Blueprint
```text
[Global Anycast / Route 53]
|
+----------------+----------------+
| |
[Region 1 (Primary)] [Region 2 (Secondary)]
| |
[Application Load Balancer] [Application Load Balancer]
| |
+--------+--------+ +--------+--------+
| | | | | |
[AZ-A] [AZ-B] [AZ-C] [AZ-A] [AZ-B] [AZ-C]
| | | | | |
+--------+--------+ +--------+--------+
| |
[Aurora Multi-AZ Primary] <------ [Aurora Global Read Replica]
```
---
## 2. Horizontal Pod Autoscaler (HPA) with Custom Metrics
```yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: payment-service-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: payment-service
minReplicas: 3
maxReplicas: 30
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 65
- type: Pods
pods:
metric:
name: http_requests_per_second
target:
type: AverageValue
averageValue: 1k
behavior:
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300 # Prevent flapping
policies:
- type: Percent
value: 10
periodSeconds: 60
```
---
## 3. Best Practices & Anti-Patterns
- **Do**: Always distribute computing across a minimum of 3 Availability Zones (AZs) per region.
- **Do**: Use exponential backoff with jitter on all downstream API retries to prevent thundering herd crashes.
- **Don't**: Never scale down immediately without a stabilization window (`stabilizationWindowSeconds: 300`).
---
## 4. Event-Driven Autoscaling with KEDA
CPU is a poor proxy for demand in queue-driven and I/O-bound systems: the work is waiting in a
broker while CPU sits at 15%. KEDA scales on the backlog itself, and to zero when there is none.
```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: order-worker
spec:
scaleTargetRef: { name: order-worker }
minReplicaCount: 0 # scale-to-zero between bursts
maxReplicaCount: 200
pollingInterval: 15
cooldownPeriod: 300
advanced:
horizontalPodAutoscalerConfig:
behavior:
scaleDown:
stabilizationWindowSeconds: 300 # slow down, fast up
triggers:
- type: aws-sqs-queue
metadata:
queueURL: https://sqs.eu-west-1.amazonaws.com/1234/orders
queueLength: "20" # target backlog per replica
awsRegion: eu-west-1
- type: prometheus # triggers compose; the highest demand wins
metadata:
serverAddress: http://prometheus.monitoring:9090
query: sum(rate(orders_received_total[2m]))
threshold: "50"
```
Choosing the signal: scale on **queue depth or lag** for async work (SQS, Kafka consumer lag,
RabbitMQ), on **in-flight requests or RPS** for synchronous services, and on CPU only for
genuinely CPU-bound compute. Always set `maxReplicaCount` below what the downstream datastore
can absorb — otherwise autoscaling converts a traffic spike into a database outage.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

