How are Quads stored in the Key/Value engines?

boltdb
schema

#1

Running the example boltdb hello world app I see the following data stored on disk:

BUCKET "log"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x01" = "\b\x018\xcf\xf8\xb3\xbb\xb5\x84Ʃ\x15B\f\x12\ndemo graph"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x02" = "\b\x028\xb4̴\xbb\xb5\x84Ʃ\x15B\x0e\x12\fis of course"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x03" = "\b\x038\xe0紻\xb5\x84Ʃ\x15B\x13\x12\x11phrase of the day"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x04" = "\b\x048\xac\xff\xb4\xbb\xb5\x84Ʃ\x15B\x0f\x12\rHello BoltDB!"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x05" = "\b\x05\x10\x03\x18\x02 \x04(\x018\x8d\xa8\xb7\xbb\xb5\x84Ʃ\x15"
BUCKET "meta"
  KEY    "horizon" = "\x05\x00\x00\x00\x00\x00\x00\x00"
  KEY    "size" = "\x01\x00\x00\x00\x00\x00\x00\x00"
  KEY    "version" = "\x02\x00\x00\x00\x00\x00\x00\x00"
BUCKET "nK2"
  KEY    "K2\xe9VQ\xae\vl\xf1h\x88\xfd\x88\xab\xba\x8bF\xad\xfbD" = "\x01"
BUCKET "n\x80\xb1"
  KEY    "\x80\xb1\n\xa3\x9b\x18\xce2\xab~\xc0Ma\x04̊\xd5\xd8\xce\xee" = "\x01"
BUCKET "n\xcf\xdb"
  KEY    "\xcf\xdb8^\x87e\xa9ꉢjG\x83\xa0\xef\xf6Q\xf5\x9a\x8d" = "\x01"
BUCKET "n\xde8"
  KEY    "\xde8\xa3\xf2\xd3[\xa5Kp\xe2\xdc#\x92\xeeI\x06p\xa5uQ" = "\x01"
BUCKET "o"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x04" = "\x05"
BUCKET "s"
  KEY    "\x00\x00\x00\x00\x00\x00\x00\x03" = "\x05"
BUCKET "vK2"
  KEY    "K2\xe9VQ\xae\vl\xf1h\x88\xfd\x88\xab\xba\x8bF\xad\xfbD" = "\x01"
BUCKET "v\x80\xb1"
  KEY    "\x80\xb1\n\xa3\x9b\x18\xce2\xab~\xc0Ma\x04̊\xd5\xd8\xce\xee" = "\x02"
BUCKET "v\xcf\xdb"
  KEY    "\xcf\xdb8^\x87e\xa9ꉢjG\x83\xa0\xef\xf6Q\xf5\x9a\x8d" = "\x03"
BUCKET "v\xde8"
  KEY    "\xde8\xa3\xf2\xd3[\xa5Kp\xe2\xdc#\x92\xeeI\x06p\xa5uQ" = "\x04"

I’m having trouble making out how cayley uses the boltdb store. It looks like a general log, some basicmeta, and then subject,object,verb,noun pairs for the Quad itself. Can someone provide a basic intro to the storage format / logic?

From what I remember of other engines, the basic for trie storage was simply storing all possible combinations.

s:o:p
s:p:o
o:s:p
o:p:s
p:o:s
p:s:o

To enable range searches.