Benchmark
In-Memory Performance
Direct cache operations (no network overhead):
╔══════════════════════════════════════════════════════╗
║ Cache Operations (5000 ops, 1000 keys) ║
╠══════════════════════════════════════════════════════╣
║ GET: 120,000+ ops/sec avg: 0.008ms ║
║ SET: 131,000+ ops/sec avg: 0.008ms ║
║ MIXED: 119,000+ ops/sec (80% read, 20% write) ║
╚══════════════════════════════════════════════════════╝Data Distribution
╔══════════════════════════════════════════════════════╗
║ 1000 keys across 3 nodes ║
║ node-0: 365 keys (36.5%) ██████████████████████ ║
║ node-1: 346 keys (34.6%) █████████████████████ ║
║ node-2: 289 keys (28.9%) ████████████████████ ║
╚══════════════════════════════════════════════════════╝Real-World: Medusa.js Integration
Benchmark against running Medusa server with PostgreSQL:
| Test | Throughput | Avg | P50 | P95 | P99 |
|---|---|---|---|---|---|
| GET /products (100 items) | 22 req/sec | 45ms | 44ms | 52ms | 97ms |
| GET /products?limit=10 | 30 req/sec | 34ms | 33ms | 42ms | 56ms |
| 10 concurrent requests | 6 req/sec | 171ms | 170ms | 206ms | 239ms |
Key insight: Cache reads are 5600x faster than PostgreSQL queries.
How to Run
bash
# In-memory benchmark
npm run benchmark
# Memory usage test
npm run memory
# Medusa integration benchmark
cd medusa && node scripts/benchmark-real.js