Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for 
change notification.

The "UseCases" page has been changed by FlipKromer.
The comment on this change is: Consistent Vote Counting example.
http://wiki.apache.org/cassandra/UseCases?action=diff&rev1=9&rev2=10

--------------------------------------------------

  = Cassandra Use Cases =
- 
  This [[http://www.dbthink.com/?p=183|summary of a mailing-list survey]] 
briefly describes how several organizations (Rackspace, Cisco, OneSpot, more) 
are using Cassandra: more detail in 
[[http://n2.nabble.com/Cassandra-users-survey-td4040068.html|this mailing-list 
thread]].
  
  The below gives simple use patterns and example implementations in high-level 
code.
@@ -10, +9 @@

  
  <<TableOfContents(2)>>
  
- ----------------------------------------------------------
+ ----------
  
  == Twissandra, a Twitter clone using Cassandra ==
- 
  Available at [[http://twissandra.com/|twissandra.com]].
  
  == A Simple Capped Log ==
- 
  ''Please help complete''
  
- * Adapt eg [[http://simonwillison.net/2009/Oct/22/redis/|this redis 
implementation]] to Cassandra
- * This 
[[http://n2.nabble.com/Use-Case-scenario-Keeping-a-window-of-data-online-analytics-td4694907.html|mailing
 list thread]] gives an overview for building a production-grade windowed 
time-series store in Cassandra.
+ * Adapt eg [[http://simonwillison.net/2009/Oct/22/redis/|this redis 
implementation]] to Cassandra * This 
[[http://n2.nabble.com/Use-Case-scenario-Keeping-a-window-of-data-online-analytics-td4694907.html|mailing
 list thread]] gives an overview for building a production-grade windowed 
time-series store in Cassandra.
  
  == Inverted Index for Document Search ==
- 
  ''Please help complete''
  
  == A distributed Priority Job Queue ==
- 
  ''Please help complete''
  
  Use Cassandra to enqueue jobs with a priority and optional delay. At each 
request, the broker assigns the ready job with highest priority.
  
+ == Consistent Vote Counting ==
+ From a conversation on the #cassandra IRC channel, here's a way to implement 
[[http://gist.github.com/416666|Consistent Vote Counting using Cassandra]] that 
doesn't depend on vector clocks or an atomic increment operation.
+ 
  == Uniq a large dataset using simple key-value columns ==
- 
  We have to batch-process a massive dataset with frequent duplicates that we'd 
like to skip.
  
  Here is ruby code using Cassandra as a simple key-value store to skip 
duplicates. You can find a real working version in the 
[[http://github.com/mrflip/wukong/blob/master/examples/keystore/conditional_outputter_example.rb|Wukong
 example code]] -- it's used to batch process terabyte-scale data on a 30 
machine cluster using Hadoop and Cassandra.
@@ -42, +38 @@

  {{{
      class CassandraConditionalOutputter
        CASSANDRA_KEYSPACE = 'Foo'
-     
+ 
        # Batch parse a raw stream into parsed objects. The parsed objects may 
have
        # many duplicates which we'd like to reject
-       # 
+       #
        # records respond to #key (only one record for the given key will be 
output)
        # and #timestamp (which can be say '0' if record has no meaningful 
timestamp)
        def process raw_records
@@ -56, +52 @@

            end
          end
        end
-     
+ 
        # Emit if record's key isn't already in the key column
        def should_emit? record
          key_cache.exists?(key_column, record.key)
        end
-     
+ 
        # register key in the key_cache
        def track! record
          key_cache.insert(key_column, record.key, 't' => record.timestamp)
        end
-     
+ 
        # nuke key from the key_cache
        def remove record
          key_cache.remove(key_column, record.key)
        end
-     
+ 
        # The Cassandra keyspace for key lookup
        def key_cache
          @key_cache ||= Cassandra.new(CASSANDRA_KEYSPACE)
        end
-     
+ 
        # Name the key column after class
        def key_column
          self.class.to_s+'Keys'

Reply via email to