ArangoDB Tutorial: Learn Multi-Model Database from Scratch (2026)
I have used ArangoDB for applications that need documents, graphs, and key-value access from a single database engine. Its multi-model approach eliminates the polyglot persistence tax.
We will cover ArangoDB architecture, AQL queries, graph traversals, indexes, transactions, and cluster deployment.
Installing ArangoDB and Understanding the Architecture
Install via package manager or Docker. arangod is the server; arangosh is the interactive shell. Web UI at http://localhost:8529.
ArangoDB supports three data models: documents (JSON), graphs (vertices/edges), and key-value. All accessible through AQL or REST API.
docker run -d --name arangodb -p 8529:8529 arangodb/arangodb
echo "db._createDocumentCollection('users')" | arangosh --server.password ""
echo "db.users.save({name:'Alice', age:30})" | arangosh --server.password ""
AQL: ArangoDB Query Language
AQL is a declarative query language combining SQL and NoSQL concepts. FOR loops over collections, FILTER, SORT, LIMIT, and RETURN.
AQL supports LET for variable assignment, COLLECT for grouping, COUNT, and subqueries. Full JSON document traversal with attribute access.
FOR user IN users
FILTER user.age > 25
SORT user.name ASC
LIMIT 10
RETURN { name: user.name, email: user.email }
Graph Traversals with AQL
ArangoDB has native graph support. Edge collections define relationships. AQL traversals use FOR v, e IN 1..3 OUTBOUND @start GRAPH @graphName.
Shortest path, k-shortest paths, and neighborhood queries. Vertex-centric indexes speed traversals on high-degree nodes.
FOR v, e, p IN 1..3 OUTBOUND 'users/alice' GRAPH 'social'
FILTER e.type == 'knows'
RETURN { friend: v.name, depth: length(p.edges) }
Indexing Strategies for Documents and Graphs
Persistent indexes (B-tree) for exact and range queries. Geo indexes for spatial queries. Fulltext indexes for word-based search.
Vertex-centric indexes for edge collections improve graph traversal performance on heavily connected nodes.
db.users.ensureIndex({ type: "persistent", fields: ["email"], unique: true });
db.knows.ensureIndex({ type: "persistent", fields: ["_from", "_to"] });
db.users.ensureIndex({ type: "fulltext", fields: ["bio"] });
Transactions and ACID Compliance
ArangoDB supports ACID transactions for multi-document operations within a single database. Use db._executeTransaction() for JavaScript transaction functions.
Streaming transactions (from 3.7) allow multi-request transactions over the HTTP API. Write-write conflicts return 409.
db._executeTransaction({
collections: { write: ["accounts"] },
action: function() {
var a1 = db.accounts.document("alice");
var a2 = db.accounts.document("bob");
db.accounts.replace("alice", {balance: a1.balance - 100});
db.accounts.replace("bob", {balance: a2.balance + 100});
}
});
Cluster Deployment: Sharding and Replication
ArangoDB cluster uses a distributed architecture with coordinators, DB servers, and agents (Raft-based). SmartGraphs co-locate related graph data.
Sharding on document key or custom shard key. Replication factor configurable. Resilient to node failures with automatic failover.
arangod --role COORDINATOR --server.endpoint tcp://0.0.0.0:8529 --agency.endpoint tcp://localhost:4001
arangod --role PRIMARY --server.endpoint tcp://0.0.0.0:8529 --agency.endpoint tcp://localhost:4001
arangod --role AGENT --server.endpoint tcp://0.0.0.0:4001 --agency.activate true
Frequently Asked Questions
Is ArangoDB free?
ArangoDB Community is free under Apache 2.0. Enterprise adds encryption, SmartGraphs, and advanced features. ArangoDB Cloud also available.
How does ArangoDB compare to Neo4j?
ArangoDB is multi-model (document + graph). Neo4j is pure graph. ArangoDB uses AQL (JSON-oriented). Neo4j uses Cypher (pattern-matching oriented).
Does ArangoDB support joins?
AQL supports graph traversals and query optimizations across collections. Document joins use FILTER with key references, not SQL-style JOINs.
Can ArangoDB handle high write throughput?
Yes. Use sharding to distribute writes. For time-series, use the SmartGraphs feature and configure appropriate replication factors.
Originally published on Ayodhyyya. Last updated June 1, 2026.