title: What's the best way to store a bi-dimensional sparse array (2d sparse matrix) ? How much size will it have in VoltDB?
body: <p><strong>Question one: Are there specialized databases to store dense and sparse matrices ?</strong> I googled but didn't find any...</p>
  
  <p>The matrix in question is huge (10^5 by 10^5) but it's sparse, which means that most of its values are zeros and I only need to store the non-zero values. So I thought of making a table like this:</p>
  
  <pre><code>   2D Matrix
  ---------------
    X   Y   val
  ---------------
    1   2    4.2
    5   1    91.0
    9   3    139.1
  </code></pre>
  
  <p>And so on. 3 columns, two for the coordinates, the third for the value of that cell in the sparse matrix. <strong>Question 2: Is this the best way to store a sparse matrix ?</strong> I also considered MongoDB but it seems that making one document per cell of the matrix would be too much overhead. Table oriented databases are slow but I can use VoltDB :) Side-node: I thought of a Redis Hash but can't make it bi-dimensional (found a way to serialize 2D matrixes and make it 1D, that way I can store in a Redis Hash or even List)</p>
  
  <p><strong>Question 3: How many bytes per line will VoltDB use ?</strong> The coordinates will be integers ranging from 0 to 10^5 maybe more, the values of the cell will be floats.</p>