A guide to ArangoDB: AQL, Graph Traversal and ArangoSearch

How to work through this course

Seven modules, about eighty hours. One piece of advice dominates everything else: build the cluster on day one and run every graph query on both deployments for the whole course.

That sounds like overhead and it is the single thing that makes this course worth doing rather than reading. A three-hop traversal can be seven milliseconds on one server and two hundred on three, and the difference is not a tuning problem - it is the nature of distributing a graph. If you learn ArangoDB on a laptop single server, everything will feel fast, you will ship a design built on those numbers, and you will find out when the data no longer fits one machine. The fixes are SmartGraphs or OneShard, both Enterprise, or a remodelling. "We will shard it later" is a safe thing to say about a document workload and an unsafe thing to say about a graph.

Four things to get right, roughly in order of how much it costs to get them wrong:

The topology and the shard key. Measure traversal on both deployments and across at least two shard key strategies before you commit. Evaluate OneShard seriously - a whole database on one DB-Server with replicas for availability gives you cluster failover and single-server traversal, which for a great many knowledge graphs is exactly the trade you want, and it is under-used because people reach for sharding as the default.

UPSERT and its unique index. Concurrent upserts without a unique index on the lookup attributes create duplicates, silently, in a collection where your whole model assumed one. Add the index, and prefer a deterministic _key with an overwrite mode wherever the natural key is derivable - a single-document operation is atomic, so there is no race to lose.

PRUNE on every traversal. FILTER discards paths after walking them; PRUNE stops the descent. At depth four on a dense graph that is seventy-four vertices against thirteen thousand. Use it from Module 2 onward, because retrofitting it means re-reasoning about every traversal you wrote.

Intermediate commits. Know whether they are on for any path where you reasoned "the transaction will protect me", because a transaction with intermediate commits is not all-or-nothing and a failure halfway leaves half the work durable. It is correct for a bulk load and wrong for anything else, and it is a setting rather than an obvious property of the code.

Three experiments worth doing properly. The topology measurement above, which is the course's central finding. The intermediate-commits demonstration in Module 3 - twenty minutes, and you will never again assume a multi-document transaction is atomic without checking. And the dump-under-load demonstration in Module 5: take a logical dump of a running cluster, restore it, and find the edge whose vertex is missing. Then write the query that finds it, and put that query in your recovery procedure, because it is the check that distinguishes a restore from a successful restore.

Two honest limits to carry into your design document rather than discover later. There is no document-level access control - a user who can read a collection reads every document in it, so tenant filtering is your application's responsibility and needs a test on every query path plus a deliberate attempt to bypass it. And ArangoSearch views are eventually consistent, so a just-written document is not immediately searchable; accept that and show the writer their own write from the write's response, and never write a test that passes because of a sleep.

And the licence. Recent Community Edition versions are source-available rather than permissive, with terms that vary by version, and the features that matter most for a graph workload at scale are Enterprise. Your job is to produce the numbers that make the decision answerable - what traversal costs on your topology, what SmartGraphs or OneShard would change, what a consistent backup requires without hot backups - and then to put the licence question in front of someone qualified with those numbers attached. Record it as an open item with an owner and a date. That is the difference between a tracked decision and a vague worry, and it is the professionally correct way to handle a question that is not yours to answer.

What to skip on a first pass. Foxx microservices beyond knowing they exist and that they can centralise tenant filtering - they are genuinely useful and not needed to learn the database. Pregel and the distributed graph algorithms, unless you have a specific analytical workload. The deprecated fulltext index, in favour of ArangoSearch and inverted indexes. Most of the geo functionality unless you need it, in which case read exactly that chapter. Datacenter-to-datacenter replication, unless you are buying it. And the legacy MMFiles storage engine entirely, along with any advice that mentions it, since RocksDB is the engine now.

Where to look things up. The official documentation has a version selector and using it is the habit. The AQL reference is the page you will have open most; the Graph traversals and ArangoSearch chapters are worth reading properly rather than searching; and the Cluster architecture and Data modeling chapters are the ones that will change what you build. The AQL optimizer rule list is unexpectedly useful when EXPLAIN does something you did not expect. And read the release notes for your version jump before any upgrade, including the supported upgrade paths, because skipping minor versions is not always allowed.

One closing thought. ArangoDB is the most genuinely multi-model engine in this programme: a knowledge graph with a search front end really is one engine here instead of four, AQL really does let you search, traverse, rank and aggregate in one statement, and for the right workload that is a substantial architectural simplification rather than a marketing line. What it asks in return is that you take the topology seriously - because the thing that collapses four components into one is also the thing that makes graph traversal sensitive to where your data lives. Measure it early, choose deliberately, write down what you chose and why, and this engine will serve you very well. Measure it late and it will be the most expensive thing you learn on the project.

arangodb database