Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A lot would depend on the performance requirements, consistency guarantees, number of systems etc (pretty much a standard). That said I do have a recommendation if willing to have it probabilistic, and you dont need it instantly constantly upto date. HyperLogLog, as you mentioned is a great choice. </p> <p>Each server could keep one in memory that as data is inserted it updates and periodically (ie once per minute) pushes to cassandra... or some other store. Due to the nature of HyperLogLog, when you want to query it you can do a column slice of the servers hyperlogs and combine them.</p> <pre><code>ColumnFamilyHyperLogLogs: { someMetricsCardinalityRow20130828: { Server1: HyperLogLogBlob, Server2: HyperLogLogBlob, Server3: HyperLogLogBlob } } </code></pre> <p>I would recommend clearsprings library thats worked great for us:</p> <p><a href="https://github.com/clearspring/stream-lib/blob/master/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLog.java" rel="nofollow">https://github.com/clearspring/stream-lib/blob/master/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLog.java</a></p> <p>It has the functionality to convert to byte array which you can use for serializing and deserializing and has methods available to combine them.</p> <p>Alternatively, something that will take a lot more space is you could just have a row for each thing, like you say unique users.</p> <pre><code>ColumnFamilyName { uniqueUserOn20130828: { "user1" : null, "user2" : null, ... } } </code></pre> <p>Then you can just call a count on the row and it will give you the exact number of unique users. This is a lot more straight forward, easier to implement but it will take a <em>lot</em> more space but with the added benefit you can look at what users were actually there that day. This can probably done pretty easy with CQL3 and sets</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload