title: Best Practice for CouchDB Document Versioning
body: <p>Following my question <a href="https://stackoverflow.com/questions/8263043/how-should-couchdb-revisions-be-treated-from-a-design-perspective">here</a> I am exmploring ideas for a generic approach to document versioning in CouchDB. While I imagine there may be no canonical approach, I had the following idea and am looking for feedback.</p>
  
  <p>I would like to maintain <em>readable</em> document ids as much as possible, so a document existing at <code>document1</code> would contain a <strong>pointer</strong> document to all existing versions on the system. The actual <strong>revision</strong> documents would be at something like <code>document1/308ef032a3801a</code> where 
   <code>308ef032a3801a</code> is some random number or hash.</p>
  
  <h2>Example</h2>
  
  <p>The pointer document</p>
  
  <pre><code>{
      "_id" : "document1",
      "versions" : [ "document1/308ef032a3801a" ]
  }
  </code></pre>
  
  <p>The version document</p>
  
  <pre><code>{
      "_id" : "document1/308ef032a3801a",
      ... actual content
  }
  </code></pre>