arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
600 stars 106 forks source link

Active failover: make Database handler always run queries against a follower #776

Closed matcho closed 1 year ago

matcho commented 1 year ago

Hi,

We currently have a setup with a realtime replication between 2 machines, where some read-only but load-heavy queries are explicitly run against the follower only.

Now we're considering switching to an active-failover setup with the same 2 machines, to achieve some kind of high availability.

Documentation says that ArangoJS connection pool can and will automatically run queries against the current leader, which is fine in most situations.

But in our case we would need the opposite: automatically run queries against the current follower.

Is there some way to achieve this ?

Thanks a lot, Greetings,

Mathias

chethan27 commented 1 year ago

can i work on this feature ?

pluma4345 commented 1 year ago

You can use allowDirtyRead to round-robin across all servers including followers. There's currently no flag for exclusively using dirty reads.