views:

133

answers:

2

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

A: 

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

Jordan S. Jones
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
@mikeal, What do you mean with "MongoDB does require a consistent data schema for indexing. "?
TTT
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
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
+3  A: 

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.couch.io/post/595079631/document-modelling-rules-of-thumb

jhs
Thanks for the link! It has great info =D
Hugo