Mastering Performance Management in CouchDB: Expert Challenge Quiz Quiz

  1. View Index Optimization

    When optimizing view indexing performance, which practice helps minimize unnecessary recomputation when documents are frequently updated?

    1. A) Designing map functions that only emit necessary fields
    2. B) Including random values in emitted keys
    3. C) Creating deeply nested reduce functions
    4. D) Rebuilding all views after each update
    5. E) Storing indexes in external storage
  2. Bulk Document Inserts

    Given a use case where thousands of new sensor readings are collected per minute, which strategy most effectively improves write throughput?

    1. A) Inserting one document at a time sequentially
    2. B) Running compaction before every insert
    3. C) Using the bulk document API to insert batches
    4. D) Querying the design document on each write
    5. E) Disabling write-ahead logging
  3. Resource Bottlenecks

    During peak load, a database instance experiences slow view queries and high disk I/O; which tuning adjustment most directly addresses this bottleneck?

    1. A) Reducing maximum database connections
    2. B) Allocating more memory for the OS file cache
    3. C) Increasing the polling interval for continuous replications
    4. D) Lowering the number of shards per database
    5. E) Decreasing the revision pruning frequency
  4. Conflict Resolution Impact

    How can frequent document update conflicts negatively impact overall replication and query performance?

    1. A) By preventing document deletion
    2. B) By increasing the size of view indexes with conflicting revisions
    3. C) By causing non-deterministic primary key assignment
    4. D) By disabling paging in query responses
    5. E) By eliminating the need for staging environments
  5. Compaction Timing

    If compaction is never triggered on a heavily updated database, what negative performance consequence will most likely result over time?

    1. A) Frequent cache invalidation
    2. B) Growing disk usage and slower read operations
    3. C) Immediate system crash after every write
    4. D) Disabling all indexes automatically
    5. E) Skipping write-ahead logs
  6. Sharding and Node Load

    A database cluster is configured with too few shards per database; which performance issue is most likely to occur as document count grows?

    1. A) Underutilization of disk space
    2. B) Excessive memory thrashing on clients
    3. C) Imbalanced distribution of documents causing hot spots
    4. D) Increased number of open databases per node
    5. E) Decreased reliability of compaction
  7. Reduce Function Efficiency

    Why should reduce functions in view queries always be associative and idempotent, especially when handling large datasets?

    1. A) To ensure they pass syntax validation
    2. B) To allow parallel aggregation across view index trees
    3. C) To decrease the storage required for each document
    4. D) To avoid needing a design document per query
    5. E) To prevent random document order during query execution
  8. Index Staleness Trade-offs

    When using a 'stale' query option for views, what is the primary benefit and trade-off regarding performance?

    1. A) Updates are more frequent, but queries become random
    2. B) Query results are faster, but may not reflect the latest data
    3. C) View indexes are deleted, but writes become more reliable
    4. D) Cache sizes increase, but index maintenance costs decrease
    5. E) Each query triggers immediate automatic compaction
  9. Attachment Storage Impact

    A photo-sharing application stores large image files as attachments in documents, causing sluggish document retrieval; which performance mitigation is recommended?

    1. A) Store only paths to images as document fields, keeping binary data elsewhere
    2. B) Compress all attachments using non-standard codecs
    3. C) Encode image files as JSON strings
    4. D) Insert attachments before the document body is created
    5. E) Use map-reduce queries to fetch raw binary attachments
  10. Querying Views vs. All Documents

    When retrieving all user profiles by email domain on a regular basis, which approach is more scalable for performance?

    1. A) Iterating through all documents using a full database scan
    2. B) Using a view with a map function emitting the email domain as the key
    3. C) Fetching each user document individually by ID
    4. D) Querying attachment metadata on every request
    5. E) Extracting domains via continuous replication