DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. Updated Sync and Async Java Drivers with ArangoDB 3.1

Updated Sync and Async Java Drivers with ArangoDB 3.1

ArrangoDB 3.1's upcoming release comes with a binary protocol to help speed things along. Read on to find out details and how it can help you get the most of out of your database.

Mark Vollmary user avatar by
Mark Vollmary
·
Oct. 24, 16 · News
Like (2)
Save
Tweet
Share
2.83K Views

Join the DZone community and get the full member experience.

Join For Free

The upcoming 3.1 release comes with a binary protocol — VelocyStream — to transport VelocyPack (internal storage format of ArangoDB introduced with the 3.0 release) data between ArangoDB and client applications. VelocyPack stores a superset of JSON, is more compact and has a fast attribute lookup. On the other hand, VelocyStream allows to send VelocyPack in an optimized form over the network. We think it would be the right time to update our official Java Driver to modernize it and to let it be the first to fully support VelocyStream.

VelocyStream is the new bi-directional async binary protocol of ArangoDB. It supports sending messages pipelined, multiplexed, uni-directional or bi-directional. The messages themselves are VelocyPack objects.

Alongside the HTTP protocol, ArangoDB also uses VelocyPack and VelocyStream. We have decided that the new Java Driver will exclusively use the new more efficient binary protocol. The new version natively supports de-/serialization of Java objects in and out of VelocyPack and also parsing of JSON documents from and in VelocyPack. But this does not only belong to the client – server communication. As a developer, you can work directly on the raw VelocyPack returned by ArangoDB over a light API and profit from the performance and data-types supported by VelocyPack like date, binary and different number-types which is much more comfortable than JSON.

To get a stable driver that takes into consideration all benefits of the new ArangoDB release, the updated version of our Java driver renounces the HTTP protocol and goes with VelocyStream.

ArangoDB Java Driver 4.0

In combination with all of the above and other improvements of ArangoDB 3.1, the new Java Driver (ArangoDB-Java-Driver 4.0) shows up to 4 times better performance in synchronous operations compared to the previous 3.0 version of the driver.

Performance Java-Driver — synchronous read — single Server:

velocystream-java-driver

We also have a detailed 10 min Java tutorial for the updated driver, explaining how to perform operations in ArangoDB.

Java Driver With Asynchronous Support

ArangoDB 3.1 and VelocyStream enable the possibility of asynchronous communication. By using Java 8 it becomes possible to get the right API for asynchronous computation — CompletableFuture.

Keeping that in mind, we have decided to also offer a second driver which supports asynchronous calls showing an even better performance — ArangoDB-Java-Driver-Async 4.0. Here we went with Java 8 and built an additional very strong async driver powered by the CompletableFuture.

What About Multi-Document Operations?

What can be better than reducing the time of a requests? Of course reducing the number of needed requests.

The two new drivers now support multi-document operations for insert/delete/update/replace. So instead of batching thousands of documents with just as many requests into ArangoDB, you can now insert thousands of documents together with only one request. Which dramatically reduces network traffic and allows for better performance.

So here we go, here are the two updated versions for the Java crowd of our community:

  • ArangoDB-Java-Driver 4.0

  • ArangoDB-Java-Driver-Async 4.0

Try them out with the RC2 of ArangoDB 3.1 and let us know what you think.

ArangoDB Driver (software) Java (programming language) Sync (Unix)

Published at DZone with permission of Mark Vollmary, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Simple Union Between .NET Core and Python
  • Top 5 PHP REST API Frameworks
  • Asynchronous HTTP Requests With RxJava
  • Best Practices for Writing Clean and Maintainable Code

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: