Do more, be better

Putting things in their place and getting them back

by John on 20 January 2011, filed under Wired in

One of the key areas I’ve been working on as part of the Luumin project is the underlying framework that glues everything together. One of the key parts of this framework is the persistence layer, or where we put stuff. As mentioned previously, we ultimately decided to settle on using Apache Cassandra for our primary datastore. Based on the principles behind Amazon Dynamo and Google’s Big Table, Cassandra is often referred to as being a NoSQL database or a column database.

While there are several available libraries that allow you to interact with Cassandra using PHP, we found that they didn’t really let us work with data in the way we wanted to. Using some of the new dynamic language features found in PHP  5.3 such as late static binding , closures and namespacing we have been able to build a very a flexible data access framework that cleanly maps between Objects in code and an underlying database that allows us to think of our code in terms of things (and not how we get to them or where they are kept). Some of the patterns for accessing and modeling that data have been inspired by the key value coding pattern found in Apple’s Coccoa/UIKit and the Enterprise Objects WebObjects frameworks.

One of the biggest differences between Cassandra and a traditional database is how you access, prepare and store your data. You store your data how you want to access it later and this framework makes it easier to prepare the data and save it with little fuss. It is also designed to let us swap the storage engine or mix and match Cassandra and traditional SQL databases should the need arise.

I think it’s choice.

Tags: , , , , ,

Something you want to say?

If you'd like to drop us a line about this blog post - or about anything at all - fill in the form below. This isn't a public comments board, so all correspondence will remain private (unless we both agree otherwise!)