Skip to content

Instantly share code, notes, and snippets.

@tomdyson
Created July 6, 2012 10:43
Show Gist options
  • Select an option

  • Save tomdyson/3059460 to your computer and use it in GitHub Desktop.

Select an option

Save tomdyson/3059460 to your computer and use it in GitHub Desktop.
Getting started with Redis - Torchbox University talk

Getting started with Redis

1. What is Redis?

  • An in-memory database but persisted to disk
  • A key value store but the values can be complex
  • A "data structure server"
  • Very fast!

2. Why would I use it?

  • For performance: it's generally a lot faster than relational databases
  • For rapid development: no schema means less code for some uses
  • For rapid development: native support for lists, hashes and sets means less code for some uses

3. Why wouldn't I use it?

  • For highly relational data: you can model relationships with namespaced keys but it gets complicated quickly.
  • Big data: everything has to live in memory
  • Very transactional data: Redis has transaction support but - on good performance settings - offers fewer reliability guarantees than e.g. PostgreSQL.

4. Use cases

  • Simple object / result / fragment caching - like memcached, but persistent.
  • Session storage - again, like memcached, but persistent. Redis is perfect for sessions!
  • For more performant / less expensive storage.
  • Queues, e.g. Celery and rq, or roll your own.
  • Set manipulation, e.g. intersections of followers.

5. Getting started

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment