5

Just wondering if there are any kind of guidelines for when you are designing a document-oriented db and I am talking especially about CouchDb.

I know that being schemaless things can take the shape that we want but, are there any best practices?

Thanks in advance! =D

FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202
Hugo
  • 6,244
  • 8
  • 37
  • 43

2 Answers2

3

Jan Lehnardt recently wrote up a useful overview of data modeling (I would not quite call it "schema" design as you correctly point out).

http://blog.couchbase.com/document-modeling-rules-thumb

Özgür
  • 8,077
  • 2
  • 68
  • 66
JasonSmith
  • 72,674
  • 22
  • 123
  • 149
-1

I don't know specifically about CouchDB, but there is something over in the MongoDB Docs about Schema Design.

Jordan S. Jones
  • 13,703
  • 5
  • 44
  • 49
  • this isn't as relevant for CouchDB. MongoDB requires consistent data schema for indexing, CouchDB does not. The map/reduce phase and normalize any schema-less data in to a unified index. – mikeal May 21 '10 at 18:57
  • @mikeal, What do you mean with "MongoDB does require a consistent data schema for indexing. "? – TTT May 21 '10 at 21:49
  • 1
    MongoDB's indexes are based on keynames which means you can only have relationships with consistent data schemes. CouchDB's map/reduce allows you to introspect a document and emit a normalized index which means the data can be truly schema-less without limiting what can be indexed. – mikeal May 25 '10 at 07:36
  • Ok maybe CouchDB offers more flexibility but MongoDB will not throw an error when a document doesn't have (one of) the keys that are indexed. – TTT May 26 '10 at 17:55