ArangoJS 6.0.0 released: Load Balancing, Automated Failover and completely written in TypeScript
Version 6.0.0 of the JavaScript driver arangojs is now available (Find it on GitHub).
This is a major release that introduces a small number of breaking changes so make sure to check out the arangojs changelog before upgrading. The most significant additions in this release are support for load balancing and automated failover as well as improved browser and TypeScript support.
In order to use the new load balancing and failover features, you can pass an array of URLs instead of a single URL when creating a new arangojs instance. The driver will automatically cycle between the URLs when the active server becomes unreachable. To cycle between servers for every request you can additionally provide the `loadBalancingStrategy` option:
const db = new Database({
url: ['http://localhost:8531', 'http://localhost:8532'],
loadBalancingStrategy: 'ROUND_ROBIN'
});
When using ArangoDB in a cluster it’s also possible to auto-populate the URL list using the new `acquireHostList` method:
await db.acquireHostList();
When using ArangoDB in standalone mode, leader/follower failover is handled automatically for each request.
Support for bower has been officially removed in this release. A precompiled browser build is now included with the npm release. When working with arangojs in client-side projects the browser build can now also be used from the unpkg CDN for development:
Finally, the arangojs project has been completely ported to TypeScript. The typings included in arangojs releases are now generated at build time from the TypeScript source, making them more reliable and useful than the community-provided typings included in previous releases.
Don’t want to use TypeScript? Don’t worry, arangojs still works with regular JavaScript. If you are using IDEs or editors like Visual Studio Code you should also see improvements in code intelligence when using arangojs in JavaScript.
Find more information about arangojs on GitHub or the yarn package details.
1 Comments
Leave a Comment
Get the latest tutorials, blog posts and news:
Is the load balancing/automated failover feature already there in the Python driver (http://github.com/joowani/python-arango)?