5 ms·
I'm terribly sorry in advance if this sounds dense, but what exactly do you use Redis for? I've been trying to work it out for some time... pointers to document
by chris_wot 13y ago
I'm terribly sorry in advance if this sounds dense, but what exactly do you use Redis for? I've been trying to work it out for some time... pointers to documentation would be fine :-)
- mmahemoff 13y agoMostly for the sweet spot between fast and pure-memory (e.g. Memcached) versus slower and high-integrity (e.g. MySQL). It works great for something like a page counter, where you want to write a lot, but don't care too much if you lost a few writes. I know other people use it as their primary database or, on the other end of the spectrum, as an in-memory replacement...it can be configured optimally for those settings too.
- dcope 13y agoPretty much for anything that I want to store to a database but is too costly do to write every time I update. For example, I use Redis store counters for things and then batch process them storing to Postgres.
- bbwharris 13y agoDashboards and aggregate data are a great use case for redis. Usually you have expensive calculations in these interfaces. Caching in redis is easy and really fast.
- inkel 13y agoI use it as the only database in most of the projects I've work at my company, using Ohm [1] as our ORM. Usually we don't have use cases with ad hoc queries like `name LIKE '%Smith'`, so it serves our purposes very well. When we need something like that, we integrate with something like Elasticsearch. [1] https://ohm.keyvalue.org/ https://ohm.keyvalue.org/
- daemon13 13y agoAre you sure "ohm" web site is trustworthy? I just got this SSL connection error Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
- nknighthb 13y agoIt's not a certificate problem, I think somebody's misconfigured the server. It's listening on port 443, but not actually responding appropriately to TLS traffic.
- elithrar 13y agoI use it for server-side sessions. Fits that use case well, especially on the performance side.
- meritt 13y agoWe use it for the job queue that our distributed workers interface with.
- stevekemp 13y agoI used to use redis as a queue, but then I switched to beanstalkd: http://kr.github.io/beanstalkd/ http://kr.github.io/beanstalkd/ That said I continue to use redis extensively, for storing data for dynamic websites (in preference to MySQL etc) and as a persistent cache for spam-testing, etc.
- orthecreedence 13y agoSeconded. I've used both for queuing, and once you start using beanstalkd, it feels like it's built for queuing. Redis can be given this role, but it's a bit more work (and back and forth). This may have changed with Lua scripting in Redis since now more advanced operations are scriptable, but until I see some good examples, it's beanstalkd for me =].
- djtriptych 13y agoshort-term memory.
- mythz 13y agoA Cache, Session Store, Message Queue (RedisMQ), Distributed Pub/Sub Messaging, Locking (i.e. between AppServers), Rate Limiting, Analytics, Timings, etc. Basically a swiss-army knife that you don't want to be without when developing high performance systems.
- Legion 13y agoI saw a great picture from a slide deck. It had a picture of Batman labeled, "Your Application". Then on the next slide, it added an arrow pointing at Batman's utility belt, and labeled it "Redis".
- Legion 13y agoFound it: http://www.scribd.com/doc/34269414/Redis-Persistence-Power http://www.scribd.com/doc/34269414/Redis-Persistence-Power
- sigzero 13y agoI have this link handy when I want to get a very quick and general idea about all the different ones: http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis
- rbolkey 13y agoAs a corollary, for what should I avoid using Redis? I've heard wonderful things, but I've also heard that you can easily abuse Redis for things that aren't appropriate.
- kcorbitt 13y agoData too large to fit in memory; anything that you're going to want to query relationally (as opposed to just key/value) in the future.
- sitkack 13y agoNot entirely true. Redis sets are quite powerful.
- yareally 13y agoWhen you find yourself doing things too often you should be doing in a relational db (i.e. lots of foreign key relations).
- robertfw 13y agowe used it to replace rabbitmq for our django->celery communication. rabbitmq had given us some configuration challenges, while redis just dropped in and worked out of the box.
- erichurkman 13y agoOne nice thing, too, is that you can keep the celery queue on a separate redis database in the same instance(s) -- to keep it separate from your other cache data. I like to keep my databases separate -- one for task queues, another for sessions, and another for truly persistent data. This makes some workflows very easy, like needing to invalidate all sessions or needing to purge transient cache data after deploying new code. Simply flush those databases.
- modoc 13y agoUse it for handling high volume voting.
- nknighthb 13y agoYou can pretty well use it for anything you want to use it for. It's persistent, networked shared memory. It's powerful and flexible enough that I've used it as a primary datastore for the back-end to a web/multi-platform app/service. I don't necessarily recommend that, but it does work and is blazing fast and extremely reliable. It's definitely some-assembly-required, though -- transactions aren't free, you have to do a little work yourself[1] (on the upside, you always know what it's doing). Also, it is intended to be used with the entire dataset in RAM. You can let it swap to some extent, but... don't. If your dataset is huge, you need something else. [1] Actually, this is less true post-2.6 with lua scripts. I should play with those more, the bulk of the code I wrote that uses Redis was built in the 2.0-2.2 timeframe.
- danudey 13y agoRealtime metrics: http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/ http://blog.getspool.com/2011/11/29/fast-easy-realtime-metri...