Alternative for Default value in Cassandra

Viewed 46

I'm looking for a way to put a default value (like in relational DBs) in a Cassandra table. After some research I found out that it is not possible to do this, however I want to be able to update some info in my table, as I don't know when the info it will arrive. e.g.

 id | value
----+--------------------------------
  2 | placeholder

I was thinking of using a placeholder value until the needed info arrives and update it, however, I'm not sure this is the best practice.

 id | value
----+--------------------------------
  2 | updated value

This must be a common case for tables. Do you know of any other approach to this use case?

1 Answers

As Aaron mentioned in comment, you should be fine with value==null till the new value arrives. I think it will be the best practice because appropriate value of column arrive later, so better to update it at that time. Till then it is better to keep it null. If client application cannot put null check then you can put placeholder value as you defined in your example.

Related