ScriptsMay 3, 2026·3 min read

TerminusDB — Document Graph Database with Git-Like Versioning

TerminusDB is a document graph database that versions your data like Git. It stores JSON documents with graph relationships, enabling branch, merge, diff, and time-travel operations on your entire dataset.

Introduction

TerminusDB combines document storage with graph relationships and full revision control. Every change creates an immutable commit, enabling Git-like workflows — branch your data, make changes in isolation, diff between versions, and merge back. This makes it especially suited for collaborative data curation and compliance-heavy environments.

What TerminusDB Does

  • Stores JSON documents with typed schemas and graph links between them
  • Versions all data changes as immutable commits with full history
  • Supports branching, merging, diffing, and rebasing of entire databases
  • Provides time-travel queries to read data at any historical point
  • Exposes a GraphQL and WOQL (Web Object Query Language) interface

Architecture Overview

TerminusDB uses a succinct data structure (HDT-inspired) that stores the graph as compressed layers. Each commit creates a new layer referencing its parent, forming a persistent data structure similar to Git's object model. Queries traverse the layer stack to reconstruct current state. Branches are lightweight pointers to specific layer commits. The storage model enables efficient diff computation between any two points in history.

Self-Hosting & Configuration

  • Deploy via Docker image or build from source (requires SWI-Prolog runtime)
  • Default API port is 6363 with built-in authentication
  • Configure storage path and memory limits via environment variables
  • Use the dashboard UI for visual schema design and data exploration
  • Client SDKs available for Python and JavaScript

Key Features

  • Git-like versioning: branch, commit, merge, and rebase your data
  • Schema-enforced JSON documents prevent data drift over time
  • Time-travel queries access any historical database state instantly
  • Diff and patch operations enable collaborative data workflows
  • Graph links between documents support relationship traversal

Comparison with Similar Tools

  • Dolt — Git for SQL tables; TerminusDB uses document-graph model instead of relational
  • MongoDB — Document store without versioning; TerminusDB adds full history and graph links
  • Neo4j — Graph DB without document model or versioning; TerminusDB combines both
  • CouchDB — Revision tracking per document; TerminusDB versions the entire database atomically
  • DVC — Data versioning for files; TerminusDB versions structured data with query support

FAQ

Q: How does branching work? A: Create a branch from any commit. Changes on that branch are isolated until you merge back, just like Git branches for code.

Q: Can I use it for large datasets? A: The succinct storage model is memory-efficient. Datasets in the millions of documents work well; billions may require careful schema design.

Q: What is WOQL? A: Web Object Query Language is TerminusDB's native query language. It's composable and Prolog-inspired, though most users prefer the Python/JS client methods or GraphQL.

Q: Is there a hosted version? A: TerminusCMS offers a hosted service with collaboration features. The database itself is fully self-hostable.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets