Response and read-data caching
DEVNU / TECHNOLOGY / REDIS
Redis should solve latency or coordination, not merely appear next to PostgreSQL in a stack diagram.
Redis fits data that needs very fast, often temporary access: caches, counters, locks, queue metadata and sessions. The key architectural question is what happens to business data when Redis restarts or a key disappears.
What does Redis own in a project?
In DEVNU architectures, Redis usually complements PostgreSQL. Durable business truth stays in the database while Redis reduces read cost, coordinates jobs, enforces rate limits or holds short-lived state.
Where the technology should solve a specific problem.
Queue and job metadata
Rate limiting
Short-lived session and token state
Distributed locks
Counters and deduplication keys
When we reach for it
High-frequency reads, queues, background jobs, rate limits, distributed locks and short-lived sessions are natural use cases. Explicit TTLs and namespaces keep temporary state from becoming an opaque dependency.
When we leave it out
For low-traffic products with simple queries, caching can create more invalidation complexity than performance benefit. Data that cannot be lost should not live only in Redis without an explicit persistence strategy.
Using the tool is easy. Operating it well is the real work.
- 01TTLs for temporary keys
- 02Domain-based prefixes and namespaces
- 03Explicit cache invalidation
- 04Fallback behaviour when Redis is unavailable
- 05No unnecessary secret storage
- 06Deliberate memory limits and eviction policies
The decisions matter more than the stack badge.
Cache-aside or write-through?
Simple cache-aside is enough for many read paths. Write-through is added when consistency requirements and the write path justify the extra coupling.
Redis or the database?
If data is business truth with relationships or transactional rules, the database is its primary home. Redis serves speed and coordination rather than replacing the data model.
Queues on Redis?
Redis-backed job queues are practical for many systems, but retry, dead-letter behaviour and idempotency still need application-level design.
Projects where Redis is part of the recorded stack.
PasarGuard — Telegram commerce & operations
A personal product that brings ordering, wallet balance, service delivery and reseller operations into one Telegram bot and Mini App flow.
- Telegram
- React
- TypeScript
- FastAPI
- PostgreSQL
- Redis
- Docker
- Nginx
Technology only matters inside a useful outcome.
Common questions about Redis
01Does every backend need Redis?+
No. Without a clear bottleneck or coordination use case, Redis is simply another service to operate.
02Can Redis replace PostgreSQL?+
Not in typical DEVNU architectures. Redis handles fast or temporary state while PostgreSQL remains the transactional source of truth.
09 / NEXT STEP
Start with the problem. Choose the stack second.
If the project needs this technology, the reason should be visible in architecture, performance, user experience or maintenance cost.
Describe the project