Ruby on Rails + PostgreSQL + Redis + Sidekiq
Production guidelines for Ruby on Rails monoliths, ActiveRecord pool tuning, Redis Sidekiq background jobs, and modern Hotwire or React UI architecture.
- Formats
- 4 files
- AGENTS.md
- 52 lines
- CLAUDE.md
- 15 lines
- Languages
- Ruby
- Updated
- Oct 2026
- Used by
- 3 projects
Writes .claude/skills/rails-postgres-redis/SKILL.md
$ curl -s --create-dirs -o .claude/skills/rails-postgres-redis/SKILL.md https://stackitfast.com/rules/rails-postgres-redis/SKILL.mdRule files
Works with Cursor · Claude Code · Windsurf · AGY
Architecture notes
Architecture Overview
Production conventions for scalable full-stack web applications and monoliths with Ruby on Rails, PostgreSQL, Redis, and Sidekiq.
Verified Real-World Adoption
This architecture is deployed by high-growth platforms including Maybe Finance, Chatwoot, and Lago.
Key Architectural Nuances
- Thread & Pool Synchronization: Aligns Puma concurrency and Sidekiq worker pools with PostgreSQL maximum connections.
- Zero-Downtime Schema Evolution: Employs concurrent indexing and lock-safe migrations for high-availability databases.
Frequently asked questions
Does this AGENTS.md work with Cursor, Claude Code, and Windsurf?
Yes — AGENTS.md is the open, cross-tool standard read by Cursor, Claude Code, Windsurf, and 30+ other agents. A dedicated .mdc file is also included for Cursor's native .cursor/rules format.
Why pass record IDs instead of ActiveRecord objects to Sidekiq?
Sidekiq serializes job arguments to JSON and stores them in Redis until a worker picks them up, sometimes minutes later. A serialized ActiveRecord object becomes a stale snapshot the instant it's enqueued, so passing the ID and re-fetching inside perform guarantees the job always operates on current data instead of an outdated copy.
Why does adding a database index need algorithm: :concurrently?
A standard PostgreSQL CREATE INDEX takes an exclusive lock on the table for the duration of the build, which blocks all writes on a live production table. The CONCURRENTLY algorithm builds the index without that exclusive lock, trading a slightly longer build time for zero write downtime — essential on any table receiving production traffic.
Used in production
Explore all stacksLago
Usage-event ingestion and pricing-expression evaluation are pulled out of the Rails request/response cycle into a dedicated Go service and a shared Rust library, so billing-critical event throughput scales independently of the API that serves the dashboard and public API.
Chatwoot
Keeping the Vue dashboard inside the Rails asset pipeline via vite_rails and running realtime updates over Action Cable lets Chatwoot ship one deployable Rails app instead of coordinating a separate frontend and websocket service, while Sidekiq and OpenSearch handle background work and search.
Maybe
A Rails 7.2 monolith with Hotwire (Turbo and Stimulus) and ViewComponent avoids a separate frontend build, while PostgreSQL plus Redis-backed Sidekiq handle storage and background account-sync jobs; the project is now archived, reflecting its final v0.6.0 architecture.