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 BenjaminYoung:
http://wiki.apache.org/couchdb/FUQ?action=diff&rev1=8&rev2=9
Comment:
* CouchDB stores its documents in a B+ tree. Each additional or updated document is stored as a leaf node, and may require re-writing intermediary and parent nodes. You may be able to take advantage of sequencing your own ids more effectively than the automatically generated ids if you can arrange them to be sequential yourself.
-
1. What is the benefit of using the _bulk_docs API instead of PUTting single documents to CouchDB?
. Aside from the HTTP overhead and roundtrip you are saving, the main advantage is that CouchDB can handle the B tree updates more efficiently, decreasing rewriting of intermediary and parent nodes, both improving speed and saving disk space.
-
1. Why can't I use MVCC in CouchDB as a revision control system for my docs?
+ . The revisions CouchDB stores for each document are removed when the database is compacted. The database may be compacted at any time by a DB admin to save hard drive space. If you were using those revisions for document versioning, you'd lose them all upon compaction. In addition, your disk usage would grow with every document iteration and (if you prevented database compaction) you'd have no way to recover the used disk space.
1. Does compaction remove deleted documents’ contents?
. We keep the latest revision of every document ever seen, even if that revision has '"_deleted":true' in it. This is so that replication can ensure eventual consistency between replicas. Not only will all replicas agree on which documents are present and which are not, but also the contents of both.
@@ -32, +31 @@
1. How do compaction and purging impact replication?
== Views ==
- 1.
- In a view, why should I not {{{emit(key,doc)}}} ?
+ 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 .view 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 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 .view 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 . How cool is that?
+ 1. I decided to roll my own !CouchApp tool or CouchDB client in . 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?