When should I use Redis in my application?

asked 2 months ago598 viewsen

7

Every architecture diagram has Redis in it. My app is a normal CRUD app with Postgres. Do I need it?

AI diagnosis

AI-generated. Not an answer — the community below confirms or corrects it. Always verify before relying on it.

asked 2 months ago

1 Answer

7
✓
✓ Accepted answer

Not by default. Postgres alone handles a lot, and every extra service is something more to run, secure and monitor. Add Redis when you have a concrete need:

1. Caching expensive computed results (leaderboards, aggregated stats) with a TTL. 2. Rate limiting and counters shared across multiple app instances. 3. Job queues (BullMQ, Sidekiq, RQ) for emails, image processing and webhooks. 4. Sessions or ephemeral state across instances. 5. Pub/Sub for real-time fan-out (chat, notifications) across servers.

Before adding it, check whether Postgres can do it well enough at your scale: UNLOGGED tables for caches, SKIP LOCKED queues (pg-boss, Graphile Worker), LISTEN/NOTIFY for pub/sub. Many products go a long way on Postgres only.

Sign in to tell others whether this worked.

answered 2 months ago

Sign in and verify your email to post an answer.