One request, four layers.
Every analytics request flows through Fastify routing, filter building, Redis cache lookup, and — on a cache miss — a parameterized PostgreSQL query. On cache hit, the database is never touched.
Tech stack
- Fastify (Node.js ESM) — JSON Schema validation on every route, plugin-based architecture, ESM imports throughout
- PostgreSQL — CTE-based analytics queries joining 5 tables; parameterized queries via pg driver
- Redis — Filter-aware cache keys with deterministic JSON serialization; graceful degradation on Redis unavailability
- LLM (Elice AI) — Structured prompt with rolling 14-day analytics context; JSON output format enforced