Best open source DB technology to store and query large, sparse matrices
You should take a look at SciDB - a database designed for precisely this use case. It has as as its major driver Michael Stonebraker, a man who knows a lot about databases - it would be an exaggeration to say that he's been involved with more database systems than most people have had hot dinners, but not by much :-)!


  "including Ingres, Illustra, Cohera, StreamBase Systems, Vertica,
  VoltDB, and Paradigm4. He was previously the Chief Technical Officer
  (CTO) of Informix. He is also an editor for the book Readings in
  Database Systems".


Google "michael stonebraker scidb sparse matrix" and subsets thereof and I think that it might be a good fit for what you want.