Side-by-side database performance comparison for e-commerce recommendation queries. Demonstrates the latency difference between EloqKV Cloud (Redis-compatible) and Neon Cloud (PostgreSQL) when data exceeds the buffer pool.
# Install dependencies
npm install
# Copy env file and fill in your credentials
cp .env.local.example .env.local
# Run locally
npm run dev| Variable | Description |
|---|---|
NEON_DATABASE_URL |
Neon PostgreSQL connection string |
ELOQKV_HOST |
EloqKV hostname |
ELOQKV_PORT |
EloqKV port (default: 6379) |
ELOQKV_USERNAME |
EloqKV username |
ELOQKV_PASSWORD |
EloqKV password |
# Small test (1K users, ~100K records) — takes ~1-5 minutes
npm run seed:small
# Large demo (1M users, ~100M records) — takes hours
npm run seed:large
# Target a specific database
npm run seed:neon
npm run seed:eloqkvNavigate to /import in the web app to configure parameters and trigger imports via the browser.
| Parameter | Small | Large | Description |
|---|---|---|---|
| Users | 1,000 | 1,000,000 | Number of users |
| Products | 1,000 | 1,000 | Product catalog size |
| Categories | 50 | 50 | Number of categories |
| Avg Purchases | 100 | 100 | Average purchases per user |
| Min Purchases | 50 | 50 | Minimum purchases per user |
| Max Purchases | 150 | 150 | Maximum purchases per user |
- Each user has ~100 purchase records stored as individual rows (Neon) / keys (EloqKV)
- The recommendation algorithm fetches 100 purchases, computes a weighted category score, and returns the best-seller in the top category
- With ~8 GB of data exceeding the buffer pool, Neon must perform ~100 random disk reads per query
- EloqKV handles the same access pattern efficiently with SRANDMEMBER + MGET
vercel deploySet environment variables in the Vercel dashboard. For the maxDuration setting (60s), a Vercel Pro plan is recommended.