Daniel Mermelstein
Daniel Mermelstein

Reputation: 1385

Is Cloudant query performance affected by the volume of data change?

In a Cloudant database with data and some secondary indexes, is it possible for a working view to become inoperable due to incoming data? I have a view that was previously working but people on my team began reporting timeouts. When I use the Cloudant dashboard to query the view I see a message: Error running query. Reason: (timeout) The request could not be processed in a reasonable amount of time.

When I look at indexing tasks I see 11 indexing tasks at various states of completion, some as low as 26%.

So is there a relation between query performance and the amount of data coming in?

Upvotes: 2

Views: 215

Answers (1)

Daniel Mermelstein
Daniel Mermelstein

Reputation: 1385

Yes, there is. If the database receives a bunch of new updates, inserts or deletes, then it updates the indexes asynchronously. In other words, it accepts all the changes and a background process will start to refresh the indexes. While the indexes are building, queries will be blocked (because the system is not strictly up to date).

In normal circumstances, this index update should at worst result in some slightly degraded query performance. But if the influx of changes is large it could result in the timeouts described.

If your application can tolerate getting stale results (i.e. ones that don't necessarily contain all the new data), you can issue your queries with a ?update=false parameter. There is more information on that in this blog post

Upvotes: 2

Related Questions