Skip to main content
GullySystem

Caching and Redis

Caching and Redis work covers sizing the instance, deciding which keys may be evicted and setting how the application behaves when Redis restarts. It applies where sessions, queues and cached values share one instance.

What ends up inside Redis

Sessions, cached values and job queues often share one instance, and each tolerates data loss differently. Separating them is worth the effort.

Sessions

Losing them logs every user out, and staff at a busy counter notice that at once.

Cached values

Safe to lose. The application should rebuild them from the database without anyone noticing, so a flushed cache costs a slower page and nothing more.

Queues and jobs

Invoices, messages and exports waiting for their turn need persistence and not eviction.

Memory, eviction and hot keys

Redis fills up. What happens then is either decided in advance or discovered at the worst moment.

Sized against real keys

Memory is set from measured key sizes and key counts, with enough headroom left to carry a busy day without evicting anything important.

Eviction policy chosen

Which keys may be thrown away under pressure is decided up front, so sessions and queues are not the first casualties.

Hot key trouble

One key read thousands of times a second can bottleneck a single instance. It needs a different shape.

When Redis restarts

Servers reboot, memory fills and providers run maintenance. An application should keep working while the cache is empty.

Graceful fallback

A cache miss should mean a slower page and never an error screen. Nothing else changes.

Stampede control

When a popular value expires, one request rebuilds it while the others wait, instead of a thousand requests reaching the database together.

Persistence where needed

Queues and sessions are configured to survive a restart, and the trade-off is explained and not assumed.

FAQ

Frequently asked questions

Do we need Redis at all?

Not always. A small site with a well-indexed database often gains little from it and adds a service to maintain. Redis is suggested when measurement shows repeated expensive work.

Can Redis run on the same server as our application?

Yes, on a single modest server, with a memory limit set so it cannot starve the application. Once traffic grows or several servers share it, a separate instance or a managed service is steadier.

Is a managed Redis service worth paying for?

It depends on who handles backups, upgrades and failover. Where nobody on your side wants that job, a managed service fits. Either option can be set up, and the self-hosted route is called out where it suits your size.

Talk to us

Tell us what you need.

Share your requirements and one of our engineers will come back to you within one business day.

  • No obligation
  • A reply within one business day
  • Your details stay private

Start with your requirements

Seven short steps that tell us what you need. An engineer reads them before getting in touch.

Share your requirements