Vishal Shah - #V's Blog

  • Archive
  • RSS
  • Ask me anything

Managing User Presence, Software Caches, Counters, Sessions among other things using Redis

I have so many developers & architect choose the wrong strategy for managing user presence, caches, stats and session information.

My simple advice that works - use redis + expire. Its blazing fast, stupidly simple and very scalable using file syncing and replication and/or sharing.

Don’t try to kludge in using the old school way using sql or custom in-memory hash tables or memcached used inappropriately.

As a software architect, the hardest thing to do is pick the right tool for the job while balancing complexity, cost, performance and learning. And if there is one tool I never forget and keep on getting back to is redis which is an intentionally kept simple but superb artifact of the KISS principle. On top of it, its genius is behind its beautiful command language that is easy to operate and learn and more importantly build upon for very-simple-to-very-complex systems based on data models that uses KV alone. It takes a while to get used to but KV > Complex data systems for most situations, especially for session management.

You will find yourself using Redis for counters, stats, caches all while not having the cold start problem since Redis fsync’s (file sync) the memory representation so you can always lose a Redis instance and bring another back up without a sweat.

And the icing on the cake? It complements and not competes with other NOSQL, especially persistent, systems. I get amused when people talk or search for redis vs cassandra vs riak vs …

The closest you probably know related to redis is memcached.

Vishal

    • #architecture
  • 1 month ago
  • Permalink
  • Share
    Tweet
← Previous • Next →

About

I love design & architecture of things that help better and simplify life in some way or other.

Day in and out I spend time as a software architect & manager, learning, architecting, designing & helping build large scale software architectures & systems that involve mobile clients, web browsers, backend servers to distributed processing systems & NOSQL data stores. I always carry my handy sketch book with me as nothing beats sharpie-on-sketchbook. Currently, my go-to tools are node.js, python, redis & riak.

I have degrees in Computer Science & Mechanical Engineering and have studied Software Engineering & Industrial Design (Fine Arts) in San Francisco, CA. Visit my home page at vishalshah.org to get in touch!

Pages

  • Reading
  • Playing
  • Work
  • Contact
  • Following

Me, Elsewhere

  • @whos_v on Twitter
  • goldenv on Flickr
  • Linkedin Profile
  • Xbox Live Profile

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr