Daniel
Daniel

Reputation: 1692

Cassandra ColumnFamily Counter Limitation

I'm trying to figure out the best schema for working with both counters and non-counting values. All these values are supposed to be in the same spot and I was going to work with wide columns but because Cassandra doesn't support a mixture of those types, that won't work.

Would I have to create a separate column family, one to hold the counters, and the other to hold other data types?

Upvotes: 1

Views: 763

Answers (2)

Amresh
Amresh

Reputation: 478

  1. Counter data type can't be used as a primary key.
  2. All non-row key fields have to have counter data type.

Upvotes: 0

abhi
abhi

Reputation: 4792

Yes you are absolutely correct in your understanding.

Always maintain separate column family for maintaining the counter. Also since in counter column familiy's new feature to have some normal column as a part of compound key gives us an added advantage.

Upvotes: 2

Related Questions