1)  Counters will probably work for this.  Our experience with counters is that it is very accurate.  But read up on how repair/inconsistencies etc is handled.
2)  You can not, as far as i know at least, have ttl on part of a counter.  What you can do, depending on how accurate it needs to be, is to have counters per hour (or something like that) and add them together for the last 10 days (which of course can be done async and stored):
  MailboxId as rowkey, Year,Month,Day,Hour as columnkey.  I don't know if this solves anything for you, but maybe you can use part of that idea for something?


----- Original Message -----

"user@cassandra.apache.org" <user@cassandra.apache.org>

Thu, 18 Jul 2013 21:30:08 +0000
MailBox Impl

Hi  - We are planning on using Cassandra for an IMAP based implementation. There are some questions that we are stuck with –


1)      Each user will have a pre-defined mailbox size (say 10 MB). We need to maintain a field to check if the mail-box size exceeds the predefined size. Will using the counter family be appropriate ?

2)      Also, we need to have retention for only 10 days. After 10 days, the previous days data will be removed. We plan to have TTL defined per message. But if we do that, how does the counter in question 1 get updated with the space cleaned due to deletion ?

3)      Do we NOT have TTL and manage the deletions within the application itself ?