Strmur runs on the Django framework with Cassandra as the primary back-end. I love Cassandra so I wanted to ensure that I (and future Strmur devs) could work with it (with some sanity) for many years to come, this meant creating our own flavour of an ORM layer.
The ORM layer uses pycassa and dictshield (thanks to Stephen McDonald for this recommendation)
The cass-orm repo is here
Our requirements for the ORM:
1. Django-esque CRUD
2. Wide row (secondary index) CRUD
3. Model Schemas
4. Data validation (through above)
5. Extending Query (like Query Managers in Django)
5. Filters for automatic secondary indexes
The intro to Cass-orm will be in 3 parts, this part will just go through some basic crud which is applicable for both normal and wide column families (schema defined and schema less)
Disclaimer: The cassandra ORM layer is still in dev/experimental mode DO NOT use it for production.
Pre-requisets: Have Cassandra installed. have run the create.sql script.
Have run unit tests to ensure everything is hunky dory.
in your settings.py file make sure to have
The tests in the github have models for a simple user/streams project.
Project: CRUD for users. Users can manage Streams. Streams have categories (gaming, science, politics). Users can filter Streams by categories.
This post will quickly show you usage for basic crud on both schema defined and schema less column families. Next post, I will go through how we can define our own Query Manager.
The model definitions (User, Stream, UserStreams) can be found in tests/models.py