Why every Developer should have Redis

Queues, counters and polling

How many times have you modelled a queue in SQL?

What about event counters?

Let's not even get started on polling for changes...

Since we started using Redis we've noticed that most of our 'hard' modelling problems in SQL will fit into a Redis construct really easily:

  • Queues - try a list or a sorted set
  • Counters - a key and using incr/decr work nicely
  • Polling - Pub/sub or blocking pops on lists

Realising this - and using it - has made a lot of our code far simpler and faster.

Don't bin SQL - it's great for relational modelling. Be familiar with Redis too - it's far better for when you want non-trivial types (and it's really fast).


blog comments powered by Disqus

Colin Howe

I'm Colin. I like coding, ultimate frisbee and startups. I am VP of engineering at Conversocial