Skip to content
North Tech Labs
Technologies — Data & infrastructure

Redis

An in-memory data store we add to a system's architecture for caching, session storage, and lightweight queueing or pub/sub — chosen where its speed solves a specific problem, not treated as a standing default.

Redis is an in-memory data store we use for caching, session storage, and lightweight queueing or pub/sub messaging inside larger systems. It sits alongside a primary database rather than replacing one, and it earns its place when a system needs very fast reads, shared session state across instances, or a simple way to pass messages between services — not as a default addition to every architecture.

Where it fits

Redis keeps data in memory rather than on disk, which makes reads and writes fast enough to sit in the request path of latency-sensitive features without becoming the bottleneck. For businesses whose application performance is limited by repeated database queries for the same data — product catalogues, configuration, computed results — caching that data in Redis can materially reduce response times and the load on the primary database.

It's also a common answer to a specific operational problem: keeping user session state consistent when an application runs on more than one server instance. Rather than pinning users to a single server or building custom session-sharing logic, Redis gives multiple instances a shared place to read and write session data, which matters once a system needs to scale horizontally or run behind a load balancer.

Beyond caching and sessions, Redis's pub/sub and list-based data structures make it a reasonable fit for lightweight queueing between services — background job dispatch, simple event notification — in systems that don't yet need the durability and delivery guarantees of a dedicated message broker. We treat that as a genuine but bounded use case, not a replacement for a proper queue where message loss would be a real problem.

We add Redis to an architecture when a concrete need justifies it, not by default. For a small, low-traffic system, running an additional in-memory service to manage can cost more in operational overhead than it saves in performance, and we say so rather than including it as a matter of habit.

Core capabilities

Caching
  • Caching frequent or expensive database queries and computed results
  • Reducing read load on a primary database under high traffic
  • Time-to-live (TTL) based expiry for keeping cached data reasonably fresh
Session storage
  • Shared session state across multiple application server instances
  • Fast session lookups on every authenticated request
  • Session and token expiry handled natively via key TTLs
Lightweight queueing & pub/sub
  • Simple background job queues for non-critical, tolerant workloads
  • Pub/sub channels for real-time notifications between services
  • Rate limiting and counters for API throttling

Common use cases

  • Database query cachingStoring the results of expensive or frequently repeated queries to reduce database load and speed up response times.
  • Session and authentication stateShared session storage so users stay authenticated consistently across multiple server instances behind a load balancer.
  • Rate limiting and countersFast, atomic counters used to enforce API rate limits or track usage in real time.
  • Real-time featuresPub/sub messaging behind live notifications, presence indicators, or other features that need fast fan-out between services.

Architecture & integration considerations

  • Cache invalidation strategyA deliberate approach to when and how cached data is refreshed or evicted, since stale cached data is one of the most common sources of subtle bugs.
  • Persistence configurationA conscious decision on whether and how Redis persistence (RDB snapshots, AOF logs) is configured, given that its default operating mode assumes data loss is tolerable.
  • Memory sizing and eviction policyCapacity planning and an explicit eviction policy, since Redis holds its dataset in memory and behaves differently once that memory fills up.
  • Operational monitoringMonitoring and alerting for a service that, once introduced, becomes a dependency the rest of the system relies on being available.

Strengths

  • Very low latencyIn-memory storage makes reads and writes fast enough to sit inside latency-sensitive request paths without becoming the bottleneck.
  • Simple, well-understood data structuresStrings, hashes, lists, sets, and sorted sets cover most caching, session, and lightweight messaging needs without unnecessary complexity.
  • Mature and widely deployedA long production track record across many types of systems means its failure modes and operational behaviour are well documented.
  • Flexible beyond pure cachingThe same instance can serve caching, session storage, rate limiting, and pub/sub, reducing the need for several separate specialised services.

Trade-offs & limitations

  • Not a durable primary datastoreRedis is built around speed, not durability guarantees; relying on it as a system of record for important data risks losing that data on a restart or failure unless persistence is deliberately configured and tested.
  • Data-loss risk outside cache/queue useUsing Redis for anything beyond cache, session, or tolerant-queue data — without treating that data as safely reconstructable — introduces a real risk of silent data loss.
  • An additional operational componentEvery Redis instance is another service to deploy, monitor, secure, and keep available; for a small, low-traffic system, that overhead can outweigh the performance gain it delivers.
  • Memory cost scales with dataset sizeBecause the dataset lives in memory, cost grows with data volume in a way that's less forgiving than disk-based storage once a dataset gets large.

When to use it

  • Database read load or query latency is a measurable bottleneck that caching can address
  • The application runs on multiple instances and needs shared, fast session state
  • A lightweight, low-durability-requirement queue or pub/sub mechanism fits the workload
  • Rate limiting or real-time counters need to be fast and centrally consistent

When another option may be more appropriate

  • The system is small or low-traffic enough that the primary database already performs well
  • The data involved needs strong durability guarantees and can't tolerate occasional loss
  • Message delivery guarantees, ordering, or replay matter more than raw throughput
  • The team has no plan to monitor or operate an additional production service

Alternatives & complementary technologies

  • MemcachedA simpler, cache-only alternative when the need is purely key-value caching without Redis's broader data structures or pub/sub.
  • A dedicated message broker (e.g. RabbitMQ, SQS)A better fit than Redis-as-queue when message durability, delivery guarantees, or complex routing matter.
  • Database-native caching or read replicasSometimes sufficient on its own, avoiding the need for a separate caching layer when the primary database can handle the load with better indexing or replicas.

Frequently asked questions

Can Redis replace our main database?

No. Redis is optimised for speed, not durability, and we don't use it as a system of record. It sits alongside a primary database for caching, sessions, or lightweight messaging.

Is data stored in Redis safe if the server restarts?

Only if persistence is explicitly configured and tested — and even then, its guarantees are weaker than a dedicated database. We treat anything stored in Redis as data that should be safely reconstructable if it's lost.

Do you add Redis to every project?

No. We add it when there's a concrete caching, session, or messaging need it solves well. For smaller or low-traffic systems, the operational overhead of running it often isn't worth the gain.

Can Redis be used as a job queue?

For lightweight, delay-tolerant background jobs, yes. For workloads where message durability or delivery guarantees matter, a dedicated message broker is a better fit.

Considering Redis for your next project?

Tell us what you're building — we'll confirm whether this is the right technology choice before recommending anything.