There are a few things you should consider before using python-arango in a multithreaded (or multiprocess) architecture.
Instances of the following classes are considered stateful, and should not be accessed across multiple threads without locks in place:
- BatchDatabase (see Batch API Execution)
- BatchJob (see Batch API Execution)
- Cursor (see Cursors)
When ArangoClient is initialized, a requests.Session instance is created per ArangoDB host connected. HTTP requests to a host are sent using only its corresponding session. For more information on how to override this behaviour, see HTTP Clients.
Note that a requests.Session object may not always be thread-safe. Always research your use case!