简体   繁体   中英

Cassandra partition problems

I am using cassandra db with billions of records, and I want to store data grouped by date. The problem is that I should query records with different timezones for users, but it stores data by GMT in partition keys. Is it correct to save different date fields for all timezones and create plenty of views? This would expand db to enormous size.

I would suggest to make modification of your application layer to perform normalization of the user's date into GMT & perform search, and then convert dates back into user's timezone after retrieval.

But be careful with using dates as partition key - this could create so-called "hot" partitions when all write traffic will hit the same partitions & won't be evenly distributed between nodes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM