Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I know that each column in Apache Cassandra has a timestamp attached and that read conflicts for a single column is resolved deterministically by looking at timestamp or by comparing the value.

Let's say I add a column to a dynamic column set. I write this column to a single node. I then later add another column to the same column store, but this time to another node. How does Apache Cassandra merge these two? Will both columns exist after the merge?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

The best way to think of a cassandra database is not as a set of databases on different nodes, but as one single database. Adding the column to the first node adds it to all other nodes. The actual number of times your data is written is determined by your replication strategy and replication factor, but each copy of the data will be the same.

Thus, if you tell the first node about a new column, the second node will automatically understand it and be able to access that data. If you tell the second node about different data in the same column, it will either overwrite the old data or add new data, depending on whether the row you're writing into already has data in it.

If you're adding a new column to the second node, then all the data in that column and the data in the first column will simultaneously exist and can be queried through either/any node.

share|improve this answer
add comment

Let's say I add a column to a dynamic column set. I write this column to a single node. I then later add another column to the same column store, but this time to another node

If you're talking about adding 2 different columns (with different names) to a single row/partition (column set?) then there will be no merge - those are different columns.

If you write the same column (With the same name) in the same row/partition then the last write (based on timestamp you provide) wins.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.