Contained in 2.5 are some small but useful AQL language improvements plus several AQL optimizer improvements.
We are working on further AQL improvements for 2.5, but work is still ongoing. This post summarizes the improvements that are already completed and will be shipped with the initial ArangoDB 2.5 release.
In the upcoming ArangoDB 2.5 (current devel branch) a new optimizer rule
move-calculations-down was added. Jan showcases in his latest blog post how queries with calculations could benefit from this new optimiser rule.
aqb module is already available to your Foxx applications. (more…)
While on a retreat in Belgium, we found some spare time to work on improvements for AQL. These will be shipped with ArangoDB version 2.4, and are already available in the devel version for testing from now on.
Here’s a short overview of the improvements:
Collect with count
A common use case in query languages is to count the number of documents returned by a query. The AQL solution for this has been to use the
LENGTH function and a subquery:
FOR doc IN collection
FILTER doc.someAttribute == someValue
This is quite long and probably unintuitive for people which have used SQL for years.
We therefore now allow using the following alternative version:
After defining a graph and filling it with some vertices and edges (see part 1), the time has come to retrieve information out of the graph.
Please take a look at the defined graph operations of ArangoDB. These will be the base for our next examples. (Yes, there may be other ways to get the results, this post does not claim completeness!)
We will start with some easy stuff and then smoothly advance in complexity.
Question: “How many edges are defined within the graph?”
The major new feature in ArangoDB 2.3 is the shiny new AQL query optimizer and executor. These parts of ArangoDB have been rewritten in 2.3 to make AQL much better for our end users.
Since one of the initial releases, ArangoDB has been shipped with AQL, the ArangoDB Query Language. AQL has since then been ArangoDB’s most versatile way of executing simple and also the not-so-simple queries.
I’ll start with an overview of query execution in previous versions of ArangoDB, and then explain the new engine and explain the differences.
MongoDB is a document DB whereas ArangoDB is a multi-model DB supporting documents, graphs and key/values within a single database. When it comes to data modeling and data querying, they pursue somewhat different approaches.
In a Nutshell: In MongoDB, data modeling is “aggregate-oriented”, avoiding relations and joins. On the other side, everybody has probably used relational databases which organize the data in tables with relations and try to avoid as much redundancy as possible. Both approaches have their pros and cons. ArangoDB is somewhat in-between: You can both model and query your data in a “relational way” but also in an “aggregate-oriented way”, depending on your use case. ArangoDB offers joins, nesting of sub-documents and multi-collection graphs. (more…)
We are proud to present ArangoDB 2.3. The first beta version is now available for download from our web-site or you can use “brew install –unstable arangodb” under Mac OS X. You can also look into the beta documentation for more information.
Please note that the main feature of this release contains a complete rewrite of the query engine, allowing much more optimizations than before – especially in the cluster case. It would be very helpful for us, if you could test this query engine as much as possible. If you find any unexpected behavior, please let us know.
The data-files can be upgraded from 2.x to 2.3. You should, however, backup the database directory beforehand, as this is a beta-release.
Features and improvements
The following list shows in detail which features have been added or improved in ArangoDB 2.3. ArangoDB 2.3 also contains several bug-fixes that are not listed here.
Having a long history with relational databases and having worked for a lot of years with SQL some people find it a bit inconvenient querying nosql databases e.g. via REST. Others have rather complex data models and need nevertheless an elegant and convenient way for querying. And we all love clean and simple interfaces.
ArangoDB comes with a couple of options for querying the data, among offer it implements the “ArangoDB Query Language” (AQL).
AQL is a declarative query language for simple and also very complex queries. Unless like in other nosql databases you can also query across collections, aggregate results, do some geo location stuff and even iterate over graphs.
So if you like the comfort of SQL but also the freedom of a schema free database, AQL is for you.
If you are interested in learning more about the concepts of ArangoDB checkout Jan’s talk and slides.
But let’s stop beating around the bush and rather have a look at specific examples.
The REST API for AvocadoDB is already available and stable and people are writing APIs using it. Awesome. As AvocacoDB offers more complex data structures like graphs and lists REST is not enough. We implemented a first version of a query language some time ago which is very similar to SQL and UNQL.