title: saving json in a custom micro graph database as key value store
body: <p>I am looking into creating a custom micro graph database</p>
  <p>The structure is from json like <a href="https://github.com/jsongraph/json-graph-specification" rel="nofollow noreferrer">this</a></p>
  <p>I am thinking about saving json structure into at key value store. Do you know how to aproceh this, like if you wanted to save the following in a key value store:</p>
  <pre><code>{
    &quot;graphs&quot;: [
      {
        &quot;directed&quot;: true,
        &quot;type&quot;: &quot;graph type&quot;,
        &quot;label&quot;: &quot;graph label&quot;,
        &quot;metadata&quot;: {
          &quot;user-defined&quot;: &quot;values&quot;
        },
        &quot;nodes&quot;: {
          &quot;0&quot;: {
            &quot;label&quot;: &quot;node label(0)&quot;,
            &quot;metadata&quot;: {
              &quot;type&quot;: &quot;node type&quot;,
              &quot;user-defined&quot;: &quot;values&quot;
            }
          },
          &quot;1&quot;: {
            &quot;label&quot;: &quot;node label(1)&quot;,
            &quot;metadata&quot;: {
              &quot;type&quot;: &quot;node type&quot;,
              &quot;user-defined&quot;: &quot;values&quot;
            }
          }
        },
        &quot;edges&quot;: [
          {
            &quot;source&quot;: &quot;0&quot;,
            &quot;relation&quot;: &quot;edge relationship&quot;,
            &quot;target&quot;: &quot;1&quot;,
            &quot;directed&quot;: true,
            &quot;label&quot;: &quot;edge label&quot;,
            &quot;metadata&quot;: {
              &quot;user-defined&quot;: &quot;values&quot;
            }
          }
        ]
      },
      {
        &quot;directed&quot;: true,
        &quot;type&quot;: &quot;graph type&quot;,
        &quot;label&quot;: &quot;graph label&quot;,
        &quot;metadata&quot;: {
          &quot;user-defined&quot;: &quot;values&quot;
        },
        &quot;nodes&quot;: {
          &quot;0&quot;: {
            &quot;label&quot;: &quot;node label(0)&quot;,
            &quot;metadata&quot;: {
              &quot;user-defined&quot;: &quot;values&quot;
            }
          },
          &quot;1&quot;: {
            &quot;label&quot;: &quot;node label(1)&quot;,
            &quot;metadata&quot;: {
              &quot;user-defined&quot;: &quot;values&quot;
            }
          }
        },
        &quot;edges&quot;: [
          {
            &quot;source&quot;: &quot;1&quot;,
            &quot;relation&quot;: &quot;edge relationship&quot;,
            &quot;target&quot;: &quot;0&quot;,
            &quot;directed&quot;: true,
            &quot;label&quot;: &quot;edge label&quot;,
            &quot;metadata&quot;: {
              &quot;user-defined&quot;: &quot;values&quot;
            }
          }
        ]
      }
    ]
  }
  </code></pre>
  <p>I am looking for an abstract design approach.</p>
  <p>I did see this <a href="https://stackoverflow.com/questions/37563210/graph-database-implemented-using-key-value-store">one</a></p>