In order to improve write performance, a lazy indexing strategy can be used. From what I understand, this essentially means that the index propagation is eventually consistent after the write (as opposed to the Consistent mode, where the write will only complete once the index update has also completed).
To allow maximum document ingestion throughput, a DocumentDB collection can be configured with lazy consistency; meaning queries are eventually consistent. The index is updated asynchronously when a DocumentDB collection is quiescent i.e. when the collection’s throughput capacity is not fully utilized to serve user requests. For "ingest now, query later" workloads requiring unhindered document ingestion, "lazy" indexing mode may be suitable.
Question:
If a document is queried for (let's say by id
) BEFORE the index has updated (it is still lazily propagating), will the document not be found OR will there be some form of "table scan" and the document returned with sacrifice in RU (and performance)?
EDIT: The above is assuming Session Consistency on the database.