ALL COVERED TOPICS

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

NAVIGATE MAIN CATEGORIES

Close

Redis: A technique for Verifying Propagation of Writes

Interesting idea on how to emulate in Redis MongoDB’s db.runCommand( { getlasterror : 1 , w : 2 } )[1] to verify propagation of writes:

Have client establish two connections - one to master Redis and one to slave Redis.

Now when client wants to write KEY to both master and slave:

  1. Client SUBSCRIBEs to  KEY on slave
  2. Client writes KEY (e.g. set foo bar) to master
  3. Client publishes KEY to master

Assuming redis-master will serialize the updates:

  1. Master will replicate KEY to slave
  2. Master will propagate PUBLISH KEY to slave

Finally client:

  1. Gets KEY event on SUBSCRIBE!

You can probably replace Pub and Subs with RPUSH and BLPOP respectively.

Couple of comments:

  1. using PUB/SUB will require an async client that will need to perform coordination to conclude the propagation was successful
  2. using RPUSH and BLPOP would allow a sync client, that can also set up timeouts

Original title and link: Redis: A technique for Verifying Propagation of Writes (NoSQL databases © myNoSQL)

via: http://groups.google.com/group/nosql-databases/browse_frm/thread/e8cb5653aad0e5f1/e9f5aa81c070b938