supabase-reliability-patterns
Implement Supabase reliability patterns including circuit breakers, idempotency, and graceful degradation. Use when building fault-tolerant Supabase integrations, implementing retry strategies, or adding resilience to production Supabase services. Trigger with phrases like "supabase reliability", "supabase circuit breaker", "supabase idempotent", "supabase resilience", "supabase fallback", "supabase bulkhead".
- License 许可
- MIT
- 最近更新
- 2026-05-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- supabase-reliability-patterns
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Implement Supabase reliability patterns including circuit breakers, idempotency, and graceful degradation. Use when building fault-tolerant Supabase integrations, implementing retry strategies, or adding resilience to production Supabase services. Trigger with phrases like "supabase reliability", "supabase circuit breaker", "supabase idempotent", "supabase resilience", "supabase fallback", "supabase bulkhead".
- allowed-tools
- Read, Write, Edit
- compatible-with
- claude-code, codex, openclaw
02 资源文件 5
- 参考文档references/circuit-breaker.md802 B
- 参考文档references/dead-letter-queue.md1.0 KB
- 参考文档references/errors.md340 B
- 参考文档references/examples.md139 B
- 参考文档references/idempotency-keys.md880 B
03 SKILL.md 正文
Supabase Reliability Patterns
Prerequisites
- Understanding of circuit breaker pattern
- opossum or similar library installed
- Queue infrastructure for DLQ
- Caching layer for fallbacks
Instructions
Production Supabase integrations must be designed to handle two failure scenarios gracefully: temporary degradation (connection timeouts, brief overloads) and complete unavailability (platform outage). Circuit breakers address the first by preventing retry storms from amplifying degraded conditions. Idempotency keys address the second by making operations safe to replay after a failure, ensuring that a network timeout does not result in duplicated writes when the request is retried.
Step 1: Implement Circuit Breaker
Wrap Supabase calls with a circuit breaker using a library like opossum. Configure the failure threshold (percentage of failures that trips the breaker), the reset timeout (how long to wait before testing recovery), and a fallback function that returns a cached or default response when the circuit is open. This prevents cascading failures from propagating to your entire application during Supabase degradation events.
Step 2: Add Idempotency Keys
Generate deterministic keys for write operations using a hash of the input parameters or a client-provided UUID. Store the idempotency key alongside the result so that duplicate requests return the original response rather than executing the operation again. This is especially important for payment or provisioning workflows where duplicate execution has financial or resource consequences.
Step 3: Configure Bulkheads
Separate queues for different operation priorities so that a surge in low-priority batch processing does not starve high-priority user-facing operations of Supabase connection capacity.
Step 4: Set Up Dead Letter Queue
Handle permanent failures gracefully by routing operations that exceed the maximum retry count to a dead letter queue. Alert on DLQ depth and provide a replay mechanism so failed operations can be reprocessed after the underlying issue is resolved.
Output
- Circuit breaker protecting Supabase calls with configured fallback behavior
- Idempotency preventing duplicate writes on retry scenarios
- Bulkhead isolation separating high and low-priority operation queues
- Dead letter queue capturing and alerting on permanent failures
Error Handling
See ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error handling.
Examples
See ${CLAUDE_SKILL_DIR}/references/examples.md for detailed examples.
Resources
Overview
Implement Supabase reliability patterns including circuit breakers, idempotency, and graceful degradation.
04 同仓库更多 Skills
zustand-store-ts
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.
zustand-store-creator
Zustand Store Creator - Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category.
zero-trust-config-helper
Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.
zapier-integration-helper
Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.
zai-cli
Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP. Use when user needs image/video analysis, OCR, UI-to-code conversion, error diagnosis, real-time web search, web page to markdown extraction, or GitHub code exploration. Trigger with phrases like "analyze this image", "search the web for", "read this page", "explore this repo", or "use zai". Requires Z_AI_API_KEY.
yt-research
Research competitor YouTube channels, niches, and trending topics for your content strategy. Use this skill whenever the user says "research channels", "analyze competitors", "find trending topics", "niche analysis", "competitive research", "what are other creators doing", "scrape YouTube channels", or wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.