replit-reliability-patterns

Featured

Implement reliability patterns for Replit: cold start handling, graceful shutdown, persistent state, and keep-alive. Use when building fault-tolerant Replit apps, handling container restarts, or adding resilience to production Replit deployments. Trigger with phrases like "replit reliability", "replit container restart", "replit data persistence", "replit always on", "replit graceful shutdown".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Replit Reliability Patterns ## Overview Production reliability patterns for Replit's container-based hosting. Replit containers restart on deploy, sleep on inactivity (Autoscale), and have ephemeral filesystems. These patterns ensure your app survives container lifecycle events gracefully. ## Prerequisites - Replit Deployment configured - External storage for persistent state (PostgreSQL or Object Storage) - Understanding of Replit container lifecycle ## Container Lifecycle ``` Container starts → App boots → Handles requests → [Sleep or Restart] │ ┌────────────────────────────────────┘ │ ┌───────┴──────┐ │ Sleep trigger │ Autoscale: no traffic for ~5 min │ Restart trigger│ Deploy, config change, or crash └───────┬──────┘ │ State lost: filesystem, in-memory data, caches State kept: PostgreSQL, KV Database, Object Storage, Secrets ``` ## Instructions ### Step 1: Graceful Startup ```typescript // Handle cold starts — prioritize accepting requests over initialization import express from 'express'; const app = express(); let ready = false; // Accept requests immediately app.listen(parseInt(process.env.PORT || '3000'), '0.0.0.0', () => { console.log(`Server started in ${process.uptime().toFixed(1)}s`); // Initialize in background initialize().catch(console.error); }); // Health endpoint...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category