I have a simple question about using Cassandra as a key-value data store. I am stil new to Casandra concepts and I have searched for an answer for this question in several places but, I could not find a solid answer for this.
Let's consider following scenario where I have set of sensor values to be stored in a database where the sensor names will be determined in runtime.
In scenario 1, I am getting following values
{"id": "001", "sensor1" : 25, "sensor2":15}
In scenario 2, I am getting following values,
{"id": "002", "sensor1" : 25, "sensor3":30}
So in these scenarios, If I use a key-value datastore such as AWS Dynamodb to store data then it would look like something as follows,
+-----+---------+---------+---------+
| ID | sensor1 | sensor2 | sensor3 |
+-----+---------+---------+---------+
| 001 | 25 | 15 | |
| 002 | 25 | | 30 |
+-----+---------+---------+---------+
But, my problem is can we accomplish the same thing with Cassandra since it is not complete key-value store.
In cassandra, I need to define table before I start persisting data into it. So in that case I need to know all of my sensor names prior to that.
I am not sure whether we can dynamically add columns to Cassandra table when we add data through 'insert' cql.
I am aware that I can store data as a map inside one of defined column in cassandra but, that it not what we do with key-value stores.