Reputation: 81
I have a question about optimal Cassandra database design: is it efficient to have a single table with a large number of skinny rows or is it efficient to have a keyspace with many many tables?
The context: I am trying to store data from multiple sensors. One approach would be to have a single table that stores data from all sensors. The other approach would be to have one table per sensor. Which one is better?
Please advise.
Upvotes: 3
Views: 329
Reputation: 438
I'd go with fewer tables for a number of reasons:
Upvotes: 3
Reputation: 11638
It is much better and idiomatic to have 1 table for all sensors. There is some overhead introduced with each table (mxbeans for metrics, files, etc.) so you don't have want to have too many.
When you say 'a large number of skinny rows' I don't anticipate that being a problem, you can have many unique keys/partitions (some crazy large number).
Upvotes: 2