ALL COVERED TOPICS

NoSQLBenchmarksNoSQL use casesNoSQL VideosNoSQL Hybrid SolutionsNoSQL PresentationsBig DataHadoopMapReducePigHiveFlume OozieSqoopHDFSZooKeeperCascadingCascalog BigTableCassandraHBaseHypertableCouchbaseCouchDBMongoDBOrientDBRavenDBJackrabbitTerrastoreAmazon DynamoDBRedisRiakProject VoldemortTokyo CabinetKyoto CabinetmemcachedAmazon SimpleDBDatomicMemcacheDBM/DBGT.MAmazon DynamoDynomiteMnesiaYahoo! PNUTS/SherpaNeo4jInfoGridSones GraphDBInfiniteGraphAllegroGraphMarkLogicClustrixCouchDB Case StudiesMongoDB Case StudiesNoSQL at AdobeNoSQL at FacebookNoSQL at Twitter

NAVIGATE MAIN CATEGORIES

Close

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)

via: http://peachshake.com/2010/10/04/initial-thoughts-on-redis/