Optimising session key storage in Redis

Tracking authenticated user sessions can be implemented in Redis using setex with some serialised JSON. It works pretty well until you have to cope with millions, or even tens of millions of sessions where the memory usage and performance can suffer. By using Redis data structures more effectively we can achieve a 70% reduction in memory usage, at the cost of both code and conceptual complexity. Is it worth it?

Read the full post on the Deliveroo Engineering blog


© 2013-2018 Greg Beech. All rights reserved.

Powered by Hydejack v7.5.0