2.4.2.1 Use Cases

1. Caching:

• Store frequently accessed data (e.g., top traders, trending coins) to avoid hitting PostgreSQL repeatedly.

• Cache ephemeral user presence, session tokens, or real-time price feeds.

2. Pub/Sub (for Socket.io)

• In a horizontally scaled environment, Node.js instances can publish/subscribe to events via Redis so that all connected clients receive relevant messages, regardless of which server instance they’re on.

3. Rate Limiting

• Track request counts per IP or user in Redis, resetting after a window to prevent brute force or spam.

Last updated