Question

As I've understood it, one feature of Cassandra is that it's supposedly 'schema free', that is (coming from a RDBS perspective) a table could contain several rows with varying columns.

In fact I never found the word 'table' used in the official documentation, instead Cassandra was supposed to use SuperColumns and ColumnFamilies: http://en.wikipedia.org/wiki/Column_family

But when reading up on CQL, the replacement language for SQL, creating these kinds of structures seems imposible, instead it closely mirrors a relation database structure that requires the creation and updating of tables and prohibiting on the fly attaching a new column to an row if it's not already defined in the table.

This is not at all what I need for my current project, as I need to store a lot of different information for each entity in the database (it's an experiment combining logic programming with probabilistic information and machine learning)

I only just begun reading up CQL, Am I missing something or is Cassandra perhaps not the right choice for my project?

Was it helpful?

Solution

For documentation you will most likely find more up to date information at the Datastax Website as there is a paid documentation team constantly working on Cassandra Docs. Datastax C* Docs

The simplest solution for having arbitrary information in a row would be to use a MAP, LIST, or SET type in your logical row.

CQL Datatypes Reference

But if you want an arbitrary layout you can create a table in CQL like

CREATE TABLE entityvalue ( key blob, column_name blob, value blob , PRIMARY KEY (key, column_name)) 

and as a final option you could just use any of the old thrift drivers and have the old style if you like but there has been a vote to stop thrift development in Cassandra.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top