Quesion about Views (Replicas, Design Documents)


2 questions about views:

  1. There is a option “view index replicas”. If I use that and have 2 replicas, then the view is not copied but generated 3 times, so I need 3 times CPU, right? If I don’t use view replicas, what happens in case of node crash? Just automatic reindex after failover, so views deliver stale (or not full result) for some minutes Or does the views deliver only part of the data until a rebalance was running?

  2. I understand that views inside a design document are running sequentially. So if I update 1’000 documents, is then the first parsed and then updates view1,view2… then next JSON is parsed, updates view1, view2 … etc? Or is it parse all 1’000 JSON and update view 1, than parse all 1’000 JSON’s again for view2 etc.? I have a bucket that contains some different document types. One of this type is heavily updated, but does not affect indices. I know that even then it has to be parsed and then skipped (I use something like "if type == “foo”). So if I update 1M documents that does not affect indices and have a design document with 8 views… does couchbase need to parse one time 1M documents… or 8 times 1m documents? Could make a huge difference in CPU usage.