TypeDB is a next-gen database with a modern programming paradigm that lets you build data applications faster, safer, and more elegantly. Its intuitive and powerful data model unifies the strengths of relational, document and graph databases without their shortcomings. TypeQL, its groundbreaking query language, is declarative, functional, and strongly-typed, drastically simplifying data handling and logic. So now, even the most nested and interconnected datasets can be managed with ease. With TypeDB, we’ve reinvented the database for the modern programming era.
- Get started by installing TypeDB.
- Explore the basics of TypeDB in our Quickstart and Crash Course.
- Master TypeDB with TypeDB Academy.
- Discover more of TypeDB’s unique Features.
- Find further articles and lectures in our Learning Center.
IMPORTANT NOTE: TypeDB & TypeQL are in the process of being rewritten in Rust. There will be significant refinement to the language, and minor breaks in backwards compatibility. Learn about the changes on our roadmap blog post. The biggest change to TypeDB 3.0 will be our storage data structure and architecture that significantly boosts performance. We’re aiming to release 3.0 in the summer this year, along with preliminary benchmarks of TypeDB.
- TypeDB was crafted to natively express and combine diverse data features, allowing users to build advanced data models from a set of simple and intuitive building blocks.
- TypeDB's type system provides safety and flexibility at the same time, which makes both prototyping and building performant, production-ready data applications fast, elegant, and enjoyable.
- With TypeDB, and its query language TypeQL, we envision databases catching up with modern typed programming languages, allowing users to write clear, intuitive, and easy to maintain code.
- TypeDB comes with a mature ecosystem include language drivers and a graphical user interface: TypeDB Studio!
TypeDB schemas are based on a modern type system that natively supports inheritance and interfaces, and follows a conceptual data modeling approach, in which user-defined types subtype (based on their function) three root types: entities, relations, and attributes.
- Entities are independent objects,
- Relations depend on their role interfaces played by either entities or relations,
- Attributes are properties with a value that can be owned by entities or relations.
Interface and inheritance for these types can be combined in many ways, resulting in highly expressive ways of modeling data.
define
full-name sub attribute, value string;
id sub attribute, value string;
email sub id;
employee-id sub id;
user sub entity,
owns full-name,
owns email @unique,
plays mentorship:trainee;
employee sub user,
owns employee-id @key,
plays mentorship:mentor;
mentorship sub relation,
relates mentor,
relates trainee;
The query language of TypeDB is TypeQL. The syntax of TypeQL is fully variablizable and provides native support for polymorphic queries. The language is based on fully declarative and composable patterns, mirroring the structure of natural language.
match $user isa user,
has full-name $name,
has email $email;
# This returns all users of any type
match $user isa employee,
has full-name $name,
has email $email,
has employee-id $id;
# This returns only users who are employees
match $user-type sub user;
$user isa $user-type,
has full-name $name,
has email $email;
# This returns all users and their type
Any query in TypeDB is semantically validated by TypeDB’s inference engine for consistency with the database schema. This prevents invalid schema updates and data inserts before they can affect the integrity of the database.
TypeDB can also work with data that is not physically stored in the database, but instead logically inferred based on user-specified rules. This enables developers to cleanly separate their source data from their application logic, often allowing for complex systems to be described by combinations of simple rules.
define
rule transitive-team-membership:
when {
(team: $team-1, member: $team-2) isa team-membership;
(team: $team-2, member: $member) isa team-membership;
} then {
(team: $team-1, member: $member) isa team-membership;
};
insert
$john isa user, has email "john@typedb.com";
$eng isa team, has name "Engineering ";
$cloud isa team, has name "Cloud";
(team: $eng, member: $cloud) isa team-membership;
(team: $cloud, member: $john) isa team-membership;
match
$john isa user, has email "john@typedb.com";
(team: $team, member: $john) isa team-membership;
# This will return both Cloud and Engineering for $team due to the defined rule
TypeDB breaks down the patchwork of existing database paradigms into three fundamental ingredients: types, inheritance, and interfaces. This provides a unified way of working with data across all database applications, that directly impacts development:
- Make use of full object model parity when working with OOP
- Ensure continuous extensibility of your data model
- Work with high-level logical abstractions eliminating the need for physical data modeling
- Let TypeDB's inference engine guarantee data-consistency at all times
- Write high-clarity code with TypeQL's near-natural queries even for the most complex databases
- Unleash the power of fully declarative and composable patterns onto your data
- TypeDB Cloud — multi-cloud DBaaS
- TypeDB Enterprise — allows you to deploy TypeDB Cloud in your own environment
- TypeDB Core — Open-source edition of TypeDB ← This repository
For a comparison of all three editions, see the Deploy page on our website.
You can download TypeDB from the GitHub Releases.
Check our Installation guide to get started.
Note: You DO NOT NEED to compile TypeDB from the source if you just want to use TypeDB. See the "Download and Run TypeDB Core" section above.
-
Make sure you have the following dependencies installed on your machine:
- Java JDK 11 or higher
- Bazel 6 or higher.
-
You can build TypeDB with either one of the following commands, depending on the targeted architecture and Operation system:
$ bazel build //:assemble-linux-x86_64-targz $ bazel build //:assemble-linux-arm64-targz $ bazel build //:assemble-mac-x86_64-zip $ bazel build //:assemble-mac-arm64-zip $ bazel build //:assemble-windows-x86_64-zip
Outputs to:
bazel-bin/
. -
If you're on a Mac and would like to run any
bazel test
commands, you will need to install:- snappy:
brew install snappy
- jemalloc:
brew install jemalloc
- snappy:
- Documentation: https://typedb.com/docs
- Discussion Forum: https://forum.typedb.com/
- Discord Chat Server: https://typedb.com/discord
- Community Projects: https://github.com/typedb-osi
If you want to begin your journey with TypeDB, you can explore the following resources:
- More on TypeDB's features
- TypeDB Quickstart and Crash Course
- TypeDB Academy
- TypeQL
- TypeDB Studio
TypeDB and TypeQL are built using various open-source frameworks and technologies throughout its evolution. Today TypeDB and TypeQL use Speedb, pest, SCIP, Bazel, gRPC, ZeroMQ, and Caffeine.
Thank you!
In the past, TypeDB was enabled by various open-source products and communities that we are hugely thankful to: RocksDB, ANTLR, Apache Cassandra, Apache Hadoop, Apache Spark, Apache TinkerPop, and JanusGraph.
Package repository hosting is graciously provided by Cloudsmith. Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.
It's released under the Mozilla Public License 2.0 (MPL 2.0). For license information, please see LICENSE.