Cassandra Basic Schema and Ruby Gem

You can get cassandra at []( and the ruby gem by running:

gem install cassandra

I did run into a problem with the trift_client gem when installing. If you get a Load Error, run this.

sudo chmod 644 /usr/local/lib/ruby/gems/1.8/gems/thrift\_client-0.6.3/lib/thrift\_client/\*.rb sudo chmod 755 /usr/local/lib/ruby/gems/1.8/gems/thrift\_client-0.6.3/lib/thrift\_client/connection

Here are some of the Cassandra commands from the video:

#connects to the cassandra server using the Twitter keyspace store =“Twitter”) # create a new column family in the Twitter keyspace called Users cf\_def = =\> “Twitter”, :name =\> “Users”) store.add\_column\_family(cf\_def) # add or create a row to the column family store.insert(“Users”, “cmaxw”, {“name” =\> “Charles Max Wood”, “description” =\> “Awesome coder”}) # remove a column from a row store.remove(“Users”, “cmaxw”, “description”)

Download17.2 MBDownload (iPod & iPhone) 20.9 MBTake the 2011 Readers Survey

Sign up for the Newsletter

Join our newsletter and get updates in your inbox. We won’t spam you and we respect your privacy.