0
votes

Say, there is a collection of documents which is updated say each 12h. The update process takes 30m-1h. If I would like to get some information from this collection during the update, it will take a long time, since the update query is executing.

Are there any approaches how to deal with it? The only idea I have so far is to maintain two collections, update on of them and get data from another, but this doesn't sound like a good idea.

1
What kind of query do you run that lasts for an hour? Can it be split into smaller pieces? Also, did you try to read data during this update query using RocksDB engine? It supports document level locks, so reads should not be blocked by writes unless they touch the same documents. - CodeManX

1 Answers

0
votes

AQL commands can only execute one UPDATE command per invocation.

If you have thousands of AQL commands that are issuing thousands of UPDATE commands, you will be able to read data in between those updates, but your data may possibly be changing.

If you are using a Foxx application to perform the updates, ensure you have set in arangod.conf the v8-contexts = 0 option so that there will be enough Foxx endpoints available for you to call REST endpoints while Foxx is also busy updating the data.

Feel free to update your question if there are other complexities with your usecase where this solution won't apply.