title: JSON design best practices
body: <p>I have designed a <a href="https://github.com/kaihendry/imap2json/blob/cf0d6ff6795aca6245edfb86294507d7e621fba8/mail.json">JSON representation of a mailbox so that I can look up mails easily</a>, for example <code>mailjson[UID].Body</code>.</p>
  
  <p>However after looking at Angularjs and Ember, templating MVC JS engines, it seems that the JSON should be of the format:</p>
  
  <pre><code>[{
     "id": 1,
     "body": "Blah blah blah..."
   },
   {
     "id": 2,
     "body": "More blah foo blah"
   },
   {
     "id": 3,
     "body": "Hopefully you understand this example"
  }]
  </code></pre>
  
  <p>And then there is some findAll(id) function to grab the item based on the id one wants, that  iterates through the JSON. So now I'm wondering does my JSON design have merit? Am I doing it wrong? Why don't people use the dict lookup design I'm using with my JSON?</p>
  
  <p>Any other tips to make sure I have a good data structure design, I would be grateful.</p>