NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter



Redis Usecase: Activity Stream Caching

Excellent Redis use case from PeachShake:

My solution was to leave the data storage in MySQL, but move the stream construction into Redis. Instead of querying MySQL and doing the joins to make the stream, I just create a linear stream for each user and append new IDs to it every time an action occurs. Then, the MySQL query is a dead-simple “SELECT WHERE IN” query using the IDs pulled from the Redis list. This takes a 30+ second MySQL query down to a few milliseconds.

As always, the main issue is synchronization. I have to make sure that the Redis activity stream matches the activities stored in MySQL.

Couple of comments though:

  • I’d try my best to avoid SELECT WHERE IN (depending on the size of the data I’d try to assemble it and place it directly in Redis. In other words, cache at a higher level)
  • Activity streams do not require perfect synchronization

Added to the Powered by Redis.

Original title and link: Redis Usecase: Activity Stream Caching (NoSQL databases © myNoSQL)