couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "FUQ" by DaveCottlehuber
Date Tue, 06 Dec 2011 10:13:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "FUQ" page has been changed by DaveCottlehuber:
http://wiki.apache.org/couchdb/FUQ?action=diff&rev1=2&rev2=3

Comment:
reducing the number of FUQups

  == Views ==
  
   1. In a view, why should I not {{{emit(key,doc)}}} ?
+   The key point here is that by emitting {{{,doc}}} you are duplicating the document which
is already present in the database (a .couch file), and including it in the results of the
view (a different .couch file, with similar structure). This is the same as having a SQL Index
that includes the original table, instead of using a foreign key.
+ 
    The same effect can be acheived by using {{{emit(key,null)}}} and ?include_docs=true with
the view request. This approach has the benefit of not duplicating the document data in the
view index, which reduces the disk space consumed by the view. On the other hand, the file
access pattern is slightly more expensive for CouchDB. It is usually a premature optimization
to include the document in the view. As always, if you think you may need to emit the document
it's always best to test.
+ 
   1. What happens if I don't ducktype the variables I am using in my view?
   1. Does it matter if my map function is complex, or takes a long time to run?
  
  == Tools ==
  
-  1. I decided to roll my own !CouchApp tool or !CouchDB client in <myfavouritelanguage>.
How cool is that?
+  1. I decided to roll my own !CouchApp tool or CouchDB client in <myfavouritelanguage>.
How cool is that?
+    Pretty cool! In fact its a great way to get familiar with the API. However - wrappers
around the HTTP API are not necessarily of great use as CouchDB already makes this very easy.
Mapping CouchDB semantics onto your language's native data structures is much more useful
to people. Many languages are already covered and we'd really like to see your ideas and enhancements
incorporated into the existing tools if possible, and helping to keep them up to date. Ask
on the mailing list about contributing!
  
+ == Log Files ==
+  1. Those Erlang messages in the log are pretty confusing. What gives?
+    Erlang kindly provides us with a stack trace. In many cases, this is enough to identify
the problem. For example, OS errors are reported as tagged tuples {{{{error,enospc}}}} or
{{{{error,enoacces}}}} which respectively is "You ran out of disk space", and "CouchDB doesn't
have permission to access that resource". Most of these errors are derived from C used to
build the Erlang VM and are documented in {{{errno.h}}} and related header files. [[http://www.ibm.com/developerworks/aix/library/au-errnovariable/|IBM]]
provides a good introduction to these, and the relevant [[http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html|POSIX]]
and [[http://www.gnu.org/s/hello/manual/libc/Error-Codes.html|GNU]] and [[http://msdn.microsoft.com/en-us/library/5814770t.aspx|Microsoft
Windows]] standards will cover most cases.
+ 

Mime
View raw message