Multi-Model Databases: Concepts, Native Architecture, and Practical AQL Queries
This article explains what native multi‑model databases are, why they are advantageous, how to model complex hierarchical data such as aircraft maintenance teams, and demonstrates real‑world AQL queries that combine document, key‑value, and graph models within a single engine.
This article, based on an ArangoDB white‑paper translation with added insights, introduces the idea of native multi‑model databases that store data as documents, key‑value pairs, and graphs in a single engine accessed through a unified query language.
What is a native multi‑model database? It combines multiple data models (document, KV, graph) under one core, allowing a single declarative query language to access any model and even mix them in one query.
Why use multi‑model databases? They address the "one size does not always fit all" problem by reducing operational complexity, avoiding data duplication, and offering better performance through a unified API and query optimizer.
Native implementation details include storing each JSON document as a KV entry (key = document primary key, value = JSON), and representing graph vertices and edges as JSON documents with _from and _to attributes.
Case study: aircraft maintenance team management demonstrates modeling millions of hierarchical parts using JSON documents for each component and a graph to represent parent‑child relationships between aircraft, engines, and sub‑components.
Example AQL queries :
Find all parts of a component (graph traversal): FOR part IN 1..4 OUTBOUND "components/Engine765" GRAPH "FleetGraph" RETURN part
Find the smallest maintainable component containing a given part: FOR component IN 0..4 INBOUND "parts/Screw56744" GRAPH "FleetGraph" FILTER component.isMaintainable == true LIMIT 1 RETURN component
List components needing maintenance next week (document query): FOR c IN components FILTER c.nextMaintenance <= "2016-12-15" RETURN {id: c._id, nextMaintenance: c.nextMaintenance}
Combined multi‑model query that joins maintenance parts with contact information: FOR p IN parts FILTER p.nextMaintenance <= "2016-12-15" FOR c IN 0..4 INBOUND p GRAPH "FleetGraph" FILTER c.isMaintainable == true LIMIT 1 FOR person IN contacts FILTER person._key == c.contact RETURN {part: p._id, component: c, contact: person}
The article also outlines modeling best practices (using JSON for flexibility, graphs for relationships), and lists numerous application scenarios such as content management, e‑commerce, fraud detection, IoT, knowledge graphs, logistics, real‑time recommendation, social networks, and workflow systems.
In conclusion, the author argues that multi‑model databases are a strategic direction for next‑generation data platforms and announces JD.com’s own native multi‑model engine, ChuBaoDB, as a concrete implementation of this vision.
JD Tech
Official JD technology sharing platform. All the cutting‑edge JD tech, innovative insights, and open‑source solutions you’re looking for, all in one place.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.