title: cassandra composite, compund keys on multi node
body: <p>I'm doing some performance tests with different designs in cassandra recently. 
  I'm currently using cassandra as write-intensive project. However, I'm going to add read-intensive part to export data with use of <code>select</code> statement.</p>
  
  <p>I'm doing time series with the following table;</p>
  
  <pre><code>CREATE TABLE events (
    date text,
    n int, // it could be 1,2,3
    id timeuuid,
    PRIMARY KEY ((date, n), id)
  );
  </code></pre>
  
  <p>I have <code>date|n</code> as the partition key. To improve read performance, I'm trying to gain leverage from the concept of wide rows. In the documentation, it is stated that;</p>
  
  <p>If the partition key's are same, they're inserted to the same physical node with widening the partition key's row.</p>
  
  <p>Therefore, I use <code>n</code> to evenly distribute the rows in case of getting  hotspots which is stated <a href="http://www.ebaytechblog.com/2012/08/14/cassandra-data-modeling-best-practices-part-2/" rel="nofollow">here</a>; </p>
  
  <p>However, in a multi-node cluster, when I insert the following;</p>
  
  <pre><code>'2013-07-30'|1, some-timeuuid 
  '2013-07-30'|1, another-timeuuid
  </code></pre>
  
  <p>I see that they're not in the same physical node.</p>
  
  <p>I get the node info by;</p>
  
  <p><code>nodetool getendpoint keyspace columnfamily some-timeuuid</code></p>
  
  <p>So, somehow I want them to be in same row to improve read performance, but not too wide in case of getting 2 billion columns. (which is the size limit of columns)</p>
  
  <p>So, any ideas what's going on here ?</p>