Real-world concurrency and performance problems you'll face running Ruby in production with hands-on challenges and solutions.
Ruby developers who want to go beyond CRUD and learn how to handle high traffic, concurrency, and distributed systems, the stuff that breaks at scale.
| Problem | Description | Difficulty |
|---|---|---|
| Cache Stampede | Prevent 1000 concurrent requests from hammering your DB when cache expires | Medium |
- Read the challenge file
- Implement your solution
- Run the test to verify
- Compare with the provided solution
bundle install
bin/setupbin/server# Cache Stampede
test/ruby_at_scale/cache_stampede_test| Dependency | Purpose |
|---|---|
| PostgreSQL | Simulates expensive database queries |
| Redis | Cache store and distributed lock backend |
| Ruby | 3.0+ recommended |
Tests delete specific Redis keys before running. They do not call flushdb - your other Redis data is safe but make sure you don't run it on critical infra.
For a full technical deep-dive on the cache stampede problem, solutions, and tradeoffs: Thundering Herd: The Problem That Kills Ruby Apps at Scale