title: CouchDB database structure - best practice
body: <p>Being new to CouchDB, just wanted to discuss the best practice for structuring a database and documents. My background is from MySQL, so still trying to get a handle on document-driven databases.</p>
  
  <p>To outline the system, we have several clients who each access a separate website with separate data. Each clients data will be split into its own database. Each database will have data constantly inserted (every 5 minutes, for at least a year) for logging events. A new document is created every 5 minutes with a timestamp and value. We also need to store some information about the client, which is a single document that doesn't ever get updated (if so, very rarely).</p>
  
  <p>Below is an example of how one client database looks...</p>
  
  <pre><code>{
      "_id": "client_info",
      "name": "Client Name",
      "role": "admin",
      ....
  },
  {
      "_id": "1199145600",
      "alert_1_value": 0.150
      "alert_2_value": 1.030
      "alert_3_value": 12.500
      ...
      ...
  },
  {
      "_id": "1199145900",
      "alert_1_value": 0.150
      "alert_2_value": 1.030
      "alert_3_value": 12.500
      ...
      ...
  },
  {
      "_id": "1199146200",
      "alert_1_value": 0.150
      "alert_2_value": 1.030
      "alert_3_value": 12.500
      ...
      ...
  },
  etc...literally millions more of these every 5 minutes...
  </code></pre>
  
  <p>My question is, is this sort of structure correct? I understand CouchDB is a flat-file database, but there will be literally millions of the timestamp/value documents in the database. I may just be being picky, but it just seems a little disorganized to me. </p>
  
  <p>Thanks!</p>