Is it possible to insert / write data without defining columns in Cassandra?

I am trying to understand the basics of Cassandra's data model. I am using CQL. As I know, a schema needs to be defined before anyone can insert into new columns. If someone needs to add any column, you can use ALTER TABLE and the INSERT value for this new column.

But the final guide to Cassandra says that Cassandra is less than a circuit.

  In Cassandra, you don't define the columns up front;  you just define the column
 families you want in the keyspace, and then you can start writing data without defining
 the columns anywhere.  That's because in Cassandra, all of a column's names are
 supplied by the client.

I got confused and did not find the expected answer. Can someone please explain this to me or tell me if I am missing something?

Thanks in advance.

+5
source share
2 answers

You read Cassandra, the Ultimate Guide: a 3/4 year book that tells you something that has changed a long time ago. Now you must determine the structure of the tables before you can write data.

Here you can find some of the reasons underlying the implementation of CQL and the lack of rejection of the scheme.

The official Datastax documentation should be your final guide.

NTN
Carlo

+4
source

Theres two different APIs for interacting with Cassandra for writing data. Firstly, it is an API that has always allowed you to create columns dynamically, but also supports the addition of metadata for your columns. Further theres a new CQL based API. CQL was created to provide another level of abstraction, which will make it more convenient for working with Cassandra. With CQL, you need to define a schema for your column names and data types. However, this does not mean that it is not possible to use dynamic columns using CQL.

See the differences here: http://www.datastax.com/dev/blog/thrift-to-cql3

+4
source

Source: https://habr.com/ru/post/1216061/


All Articles