
AN OPEN SOURCE GRAPH DATABASE & DOCUMENT STORE
TerminusDB is a multi-model and distributed open-source graph database and document store. At it’s heart is a collaboration model providing Git-for-data features such as branch, merge, workflows, and revision control.
A document-oriented graph database with version control & collaboration model
As well as being an open-source graph database and document store, TerminusDB is also an immutable database, storing changes as deltas. Immutability enables collaboration workflows, version control, diff and patch, time travel, and the ability to branch, clone, and merge your database. Use TerminusDB to model and build data-intensive, collaborative applications. Its features include:
Faster Time to Market
TerminusDB & TerminusCMS are fast – really fast. Build an application MVP in a single sprint.
Schema First
The flexible and extendable JSON schema syntax acts as a blueprint to model data and develop scalable applications.
Auto UI Generation
Document frames for viewing, adding, and editing data are automatically generated from your schema.
Git for Data
A versioning first database, fork, clone, branch, and merge, just like Git, to collaborate with colleagues, time travel, and develop with the safety of undo.
Document Oriented
Work with JSON documents and build relationships between documents in a powerful knowledge graph.
Easy
Quick to install, start building your apps in minutes.
take a technical deep dive
TerminusDB CTO and Co-Founder, Gavin Mendel-Gleason, has written a three-part blog explaining the technical internals of the open-source graph database and document store, TerminusDB. If you want a technical overview without marketing talk, this series is ideal for you.
TerminusDB Internals
Part 1 of TerminusDB Internals, looks at the guts and how we’ve built an in-memory graph database to avoid thrashing and slow performance.
TerminusDB Internals Part 2
Part 2 of TerminusDB Internals looks at how we deal with mutating data with succinct data structures and graph storage.
TerminusDB Internals Part 3
Part 3 of TerminusDB Internals looks at how we sort data lexically and how we have overcome some of the issues that come with this approach.
CI/CD for your database
Store data as JSON and utilize the power of graph database relationships. TerminusDB’s collaboration model lets you branch, clone, and merge your database and use workflows, approval processes, time travel, and version control to build applications that enable many users to share and use data concurrently.
# Create database
terminusdb db create admin/philosophers
# Add a schema
echo '{ "@type" : "Class",
"@id" : "Philosopher",
"name" : "xsd:string" }' | terminusdb doc insert admin/philosophers -g schema
# Add a JSON document
echo '{ "name": "Socrates" }' | terminusdb doc insert admin/philosophers
# Get the document back
terminusdb doc get admin/philosophers
# Prove that it works, Socrates is there!
# Branch the database
terminusdb branch create admin/philosophers/local/branch/changes --origin admin/philosophers
# Add more philosophers to new branch
echo '{ "name": "Plato" }' | terminusdb doc insert admin/philosophers/local/branch/changes
echo '{ "name": "Aristotle" }' | terminusdb doc insert admin/philosophers/local/branch/changes
# Look at the difference between branches
terminusdb diff admin/philosophers --before-commit main --after-commit changes | jq
# Apply the differences to main
terminusdb apply admin/philosophers --before-commit main --after-commit changes
# Look at the difference again
terminusdb diff admin/philosophers --before-commit main --after-commit changes | jq
#!/usr/bin/env python3
from terminusdb_client import Client
from random import random
client = Client("http://localhost:6363", account="admin", team="admin", key="root")
client.connect()
db_name = "philosophers" + str(random())
client.create_database(db_name)
client.connect(db=db_name)
# Add a philosopher schema
schema = {"@type": "Class",
"@id": "Philosopher",
"name": "xsd:string"
}
# Add schema and Socrates
client.insert_document(schema, graph_type="schema")
client.insert_document({"name": "Socrates"})
# Verify that it added in the DB
print(list(client.get_all_documents()))
# Create new branch and switch to it
client.create_branch("changes")
client.branch = "changes"
# Add more philosophers
client.insert_document({"name": "Plato"})
client.insert_document({"name": "Aristotle"})
# Diff the branches
diff = client.diff_version("main", "changes")
print(diff)
# Apply the differences to main with apply
applied = client.apply("main", "changes", branch='main')
print("Applied:")
print(applied)
# Diff again
diff_again = client.diff_version("main", "changes")
print("Second diff:")
print(diff_again)
const Client = require('@terminusdb/terminusdb-client');
const client = new Client.WOQLClient(
'http://127.0.0.1:6363',
{
user: 'admin',
key: 'root',
},
);
async function main() {
// Create a database
await client.createDatabase('philosophers', {
label: 'Philosophers',
comment: 'Philosophers by name',
schema: true,
});
// Add the philosopher type
const schema = {
'@type': 'Class',
'@id': 'Philosopher',
name: 'xsd:string',
};
await client.addDocument(schema, { graph_type: 'schema' });
// Add Socrates
await client.addDocument({ name: 'Socrates' });
// Get back all documents
const doc = await client.getDocument({ as_list: true });
console.log(doc);
// Create a branch
await client.branch('changes');
// Add more philosophers to the new branch
await client.addDocument({ name: 'Plato' });
await client.addDocument({ name: 'Aristotle' });
// Look at the differences between branches
const diffs = await client.getVersionDiff('main', 'changes');
console.log(diffs);
// Apply the differences to main
client.checkout('main');
await client.apply('main', 'changes', 'apply changes');
// Check the for any remaining differences between branches
const remaining_diffs = await client.getVersionDiff('main', 'changes');
console.log(remaining_diffs);
}
main();
TerminusDB - Build data-intensive apps fast
The TerminusDB schema language connects JSON documents into a graph. It is a distributed database with a collaboration model, designed to be like Git, but for data. Model your data and schema, store data as JSON, and use graph relationships within your queries to build data-first apps.
TerminusCMS
TerminusCMS is a headless content management system. Built on top of TerminusDB, it is a cloud service to build headless systems for complex and collaborative applications.
Front-end developers
can build quickly with
JSON and GraphQL
Manage your teams,
access tokens, time
travel, and create
new projects.
Editing frames are
auto-generated from
the schema along with
validation & localixation
Schema modeler,
document explorer,
GraphQL & Datalog
API playground, &
change request
management.
Latest stories from TerminusDB
Building a Vector Database to Make Use of Vector Embeddings
Vector databases are all the rage at the moment and it’s not just hype. The advance of AI, which is making use of vector embeddings, has significantly increased the buzz. This article talks about how we implemented a vector database in Rust in a week to give us semantic indexing and entity resolution using OpenAI to define our embeddings.
Schema Migration for Graph Databases
This article discusses change management for data and how we manage schema migration and changes to the data model.
Knowledge Graph Schema Design Patterns and Principles
Graph schema design is very important but unfortunately, there isn’t a lot of guidance, this article aims to provide some assistance for those looking to understand schema modeling.
READY TO GET STARTED?
Start building today with TerminusDB. Follow the link below to the installation documentation.