cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Cassandra Wiki] Update of "ThomasBoose/dbms implementation" by ThomasBoose
Date Wed, 12 Jan 2011 19:00:12 GMT
Dear Wiki user,

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

The "ThomasBoose/dbms implementation" page has been changed by ThomasBoose.


New page:
#format wiki
#language en
A DBMS layer for cassandra with a test script.

= File =

= Description =
This is an implementation of the DBMS layer I wrote about in:

[[EERD model components to Cassandra Column family's]]
The objective is to create a layer between a python application and a cassandra database that
will handle the most trivial DBMS rules. I implemented this by introducing two system columnfamilys
"deleted" and "dbms". The dbms columnfamily stores datatypes, foreignkey (reference), reverse
lookups (reverse) and required field definitions. The "deleted" columnfamily stores key values
of columnfamilys that are deleted. Single values are deleted by placing a tombstone in front
of the value.
Using this dbms layer is simple. instead of creating a pycassa ColumnFamily object and using
the insert, get, get_range and remove, you call the generic functions: dbms.insert, dbms.get,
dbms.get_range and dbms.remove. You need to include the name of the columnfamily as first
parameter so:
instead of:
  cf_group = pycassa.ColumnFamily(pool,'DBMS','group')
  cf_group.insert('nl.boose.admin',{'name':'Universe admin','moderator':'nl.boose.admin'})
you state:
  dbms.insert('group', 'nl.boose.admin',{'name':'Universe admin','moderator':'nl.boose.admin'})

= Install =
To test this script follow these steps:
- Make sure you have cassandra running (version 0.6.9)
- Make sure you have python, pycassa (version 0.3.0), hashlib and time installed on the client
- Dateutil is included in the archive.
- Stop cassandra (/etc/init.d/cassandra stop on ubuntu)
- In storage-conf.xml replace by the IP adres of your cassandra server.
- Replace the storage-conf.xml file on you cassandra server by the one in this archive
    alternatively you can add the Keyspace "DBMS" to your current storage.conf.
- Restart cassandra
- In and, replace by the IP adres of your cassandra server.
- Run: python
    This will populate your dbms repo with dbms rules.
- Run: python
    This will demonstrate the dbms functions.
- Let me know what you think
- Please notify me of changes, expiriments and other intrest in this project.
- Statements about implementations on more recent versions of cassandra and pycassa are also

View raw message