title: CouchDB a real world example
body: <p>Tonight in my daily tech Googling I came across couchDB, after seeing tons of presentations about how it perform ten to hundred times better then any RDBM, how it would save us from SQL languages, tables, primary keys and so much more. I decided myself to try it myself. Only problem it seems I am unable to figure out how it works. </p>
  
  <p>Like for a start I would like to code a web contact manager using couchDB. The project would enable user to do basic stuff like</p>
  
  <ul>
  <li>Create/ Edit / Delete contacts</li>
  <li>see a list of their contact ordered</li>
  <li>search them on various criteria</li>
  </ul>
  
  <p>So how do I start ? </p>
  
  <p>Here some of my thoughts </p>
  
  <ul>
  <li>create a database per user like July, Ann</li>
  <li>in those DB, add some document with type contact, the document would look like this at first place see code 1</li>
  <li>create / edit / delete is straight forward just need to do the PUT, POST, DELETE in the good database</li>
  <li>searching would be handled by couchdb-lucene like dnolen suggested</li>
  </ul>
  
  <p>now here come the difficult part, I don't really understand the whole map/reduce concept and how I can use that to do the jobs I used to do with SQL. Also with views how do you handle paging, also grouping. </p>
  
  <p>I would like to build a screen with a paging set of links something like this</p>
  
  <pre>
  John, Doe
  Johny, Hallyday
  Jon, Skeet
  
  A B C D E F **J** etc .... &lt;-- those are link to see persons with that first name
  </pre>
  
  <p>what view should I create to achieve that, if you can provide samples it would wonderful.</p>
  
  <hr>
  
  <p>Contact document.</p>
  
  <pre><code>{
      type: 'contact',
      firstname: 'firstname',
      lastname: 'lastname',
      email: ['home': 'foobar@foobar.net', 'work': 'foobar@foobar-working.net'],
      phone: ['home': '+81 00 0000 0000'],
      address: []
      ... some other fields maybe ...
  }
  </code></pre>