TypeDB

{{Short description|Open-source, strongly-typed database}}

{{Infobox software

| name = TypeDB

| logo = File:TypeDB.png

| logo alt =

| logo caption =

| screenshot =

| screenshot alt =

| caption =

| collapsible =

| author = Haikal Pribadi

| developer = TypeDB

| released = {{Start date and age|2016|09|09|df=yes/no}}

| discontinued =

| ver layout =

| latest release version = 2.28.3

| latest release date = {{Start date and age|2024|06|10|df=yes/no}}{{cite web |title=Releases · vaticle/typedb |url=https://github.com/vaticle/typedb/releases |website=GitHub |language=en}}

| latest preview version =

| latest preview date =

| programming language = Java{{Cite web|url=https://db-engines.com/en/system/TypeDB|title=TypeDB System Properties|website=DB Engines|language=en}}

| operating system = Cross-platform

| license = AGPL 3.0

| website = {{URL|https://www.typedb.com}}

| repo = {{URL|https://github.com/vaticle/typedb}}

}}

{{Portal|Free and open-source software}}

TypeDB is an open-source, distributed database management system that relies on a user-defined type system to model, manage, and query data.

Overview

The data model of TypeDB is based on primitives from conceptual data modeling, which are implemented in a type system (see § Data and query model). The type system can be extended with user-defined types, type dependencies, and subtyping, which together act as a database schema. The model has been mathematically defined under the name polymorphic entity-relation-attribute model.Dorn & Pribadi 2024

To specify schemas and to create, modify, and extract data from the TypeDB database, programmers use the query language TypeQL. The language is noteworthy for its intended resemblance to natural language, following a subject–verb–object statement structure for a fixed set of "key verbs" (see § Examples).

History

TypeDB has roots in the knowledge representation system Grakn (a portmanteau of the words "graph" and "knowledge"), which was initially developed at the University of Cambridge Computer Science Department.{{Cite web|url=https://dbdb.io/db/typedb|title=TypeDB|website=Database of Databases|date=30 July 2024 }} Grakn was commercialized in 2017, and development was taken over by Grakn Labs Ltd. Later that year, Grakn was awarded the "Product of the Year" award by the University of Cambridge Computer Science Department.{{Cite web|url=https://www.cst.cam.ac.uk/ring/awards|title=Hall of Fame|website=Department of Computer Science and Technology|date=23 January 2018 }}

In 2021, the first version of TypeDB was built from Grakn with the intention of creating a general-purpose database.{{Cite web|url=https://github.com/vaticle/typedb/releases/tag/2.1.0|title=TypeDB 2.1.0|website=Github}} The query language of Grakn, Graql, was incorporated into TypeDB's query language, TypeQL, at the same time.

TypeDB Cloud, the database-as-a-service edition of TypeDB, was first launched at the end of 2023.{{Cite web|url=https://typedb.com/blog/new-foundations-for-building-with-typedb|title=New Foundations for Building with TypeDB|website=TypeDB Blog|date=27 March 2024 }}

=Grakn version history=

The initial version of Grakn, version 0.1.1, was released on September 15, 2016.{{Cite web|url=https://github.com/vaticle/typedb/releases/tag/0.1.1|title=Grakn 0.1.1|website=Github}}

Grakn 1.0.0 was released on December 14, 2017.{{Cite web|url=https://github.com/vaticle/typedb/releases/tag/1.0.0|title=Grakn 1.0.0|website=Github}}

Grakn 2.0.0 was released on April 1, 2021.{{Cite web|url=https://github.com/vaticle/typedb/releases/tag/2.0.0|title=Grakn 2.0.0|website=Github}}

=TypeDB version history=

TypeDB 2.1.0, the first public version of TypeDB, was released on May 20, 2021.

Features

TypeDB is offered in two editions: an open-source edition, called TypeDB Core, and a proprietary edition, called TypeDB Cloud, which provides additional cloud-based management features.

TypeDB features a NoSQL data and querying model, which aims to introduce ideas from type systems and functional programming to database management.{{Cite web|url=https://master.typedb.com/fundamentals#functional-database-programming|title=Functional Database Programming Paradigm|website=TypeDB}}

=Database architecture=

General database features include the following.

{{bulleted list

| ACID-compliance{{Cite web|url=https://db-engines.com/en/system/TypeDB|title=TypeDB System Properties|website=DB Engines|language=en}}

| Static type-checking of queries{{Cite web|url=https://db-engines.com/en/system/TypeDB|title=TypeDB System Properties|website=DB Engines|language=en}}

| Graphical user interface (TypeDB Studio){{Cite web|url=https://db-engines.com/en/system/TypeDB|title=TypeDB System Properties|website=DB Engines|language=en}}

| Storage engine based on RocksDB{{cite web |title=TypeDB Github|url=https://github.com/vaticle/typedb|date=June 2024|website=GitHub|language=en}}

| Synchronous replication through RAFT for scalability{{Cite web|url=https://db-engines.com/en/system/TypeDB|title=TypeDB System Properties|website=DB Engines|language=en}}

| TLS support

| Unicode support

}}

=Data and query model=

TypeDB's data and query model differs from traditional relational database management systems in the following points.

{{bulleted list

|Instead of tables and columns, TypeDB employs types, subtypings between types, and type dependencies to describe the database schema. It is argued that this may facilitate schema extensions and normalization, and may help clarify data dependencies.Dorn & Pribadi 2024, §1.7

|Instead of formulating queries with algebraic operators as in SQL, TypeQL queries are sequences of statements that represent composite types. It is argued that this yields a “more declarative” querying style (see § Examples).Dorn & Pribadi 2024, §1.5

|TypeDB provides support for Datalog-like functions (based on the correspondence of logical implication to function types), which can be defined recursively. This can have advantages for graph data workloads, as most graph algorithms are formulated recursively.Dorn & Pribadi 2024, §3.2

|TypeDB's data model, based on subtyping and type dependencies, is aimed at modeling a variety of data structures. This subsumes relational data, structured tree-like data, structured graph-like data, data with inheritance, and hypergraph-like data.Sijs & Fletcher, 2022Dorn & Pribadi 2024, App. A}}

=Limitations=

By relying on a non-standard data and query model, TypeDB (at present) has no support for the integration of established relational or column-oriented database standards, file formats (such as CSV, Parquet), or the query language SQL. Moreover, TypeDB has no direct facility for working with unstructured data or vector data.

Query language

TypeQL, the query language of TypeDB, acts both as data definition and data manipulation language.

The query language builds on well-known ideas from conceptual modeling, referring to independent types holding objects as entity types, dependent types holding objects as relation types, and types holding values as attribute types.{{Cite web|url=https://typedb.com/docs/learn/9-modeling-schemas/9.1-the-pera-model|title=TypeDB Lecture Course|date=June 2024|website=TypeDB|language=en}} The language is composed of query clauses comprising statements. Statements, especially for data manipulation, usually follow a subject–verb–object structure.

The formal specification of the query language was presented at ACM PODS 2024, where it received the "Best Newcomer" Award.{{Cite web|url=https://2024.sigmod.org/pods_awards.shtml|title=PODS Awards|website=ACM SIGMOD/PODS|date=June 2024}}

=Examples=

The following (incomplete) query creates a type schema using a {{code|define}} query clause.

define

person sub entity,

owns name,

plays booking:passenger;

booking sub relation,

relates passenger,

relates flight,

owns booking_date;

name sub attribute,

value string;

...

The following query retrieves objects and values from the database that match the pattern given in the {{code|match}} clause.{{cite journal |url=https://dl.acm.org/doi/suppl/10.1145/3651611/suppl_file/TypeQL_PODS_2024.mp4|date=June 2024 |doi=10.1145/3651611 |language=en|url-access=subscription |title=TypeQL: A Type-Theoretic & Polymorphic Query Language |last1=Dorn |first1=Christoph |last2=Pribadi |first2=Haikal |journal=Proceedings of the ACM on Management of Data |volume=2 |issue=2 |pages=1–27 }}

match

$j isa person, has name $n;

$n contains "Jane";

$b isa booking,

links (passenger: $j, flight: $f);

has booking_date >= 2024-01-01;

$f has flight_time < 120;

$f links (destination: $c);

$c has name "Santiago de Chile";

Licensing

The open-source edition of TypeDB is published under the Mozilla Public License.{{cite web |title=TypeDB Github|url=https://github.com/vaticle/typedb|date=June 2024|website=GitHub|language=en}}

References

{{reflist|30em}}

Bibliography

{{refbegin}}

  • {{citation|last1=Dorn|first1=Christoph|last2=Pribadi|first2=Haikal |title=TypeQL: A Type-Theoretic & Polymorphic Query Language |date=2024|journal= Proceedings of the ACM on Management of Data|volume=2 |issue=2 |pages=1–27 |location=New York, NY, USA|publisher=Association for Computing Machinery|doi=10.1145/3651611}}

{{refend}}

{{refbegin}}

  • {{citation|last1=Sijs|first1=Joris|last2=Fletcher|first2=James|chapter=On a hypergraph structuring semantic information for robots navigating and conducting their task in real-world, indoor environments |title=2022 26th International Conference on Methods and Models in Automation and Robotics (MMAR)|date=2022|pages=430–435 |publisher=IEEE|doi=10.1109/MMAR55195.2022.9874265|isbn=978-1-6654-6858-9 |chapter-url=http://resolver.tudelft.nl/uuid:31edb3d1-f849-41d2-b1c3-a865434680e2 }}

{{refend}}

Category:Graph databases

Category:Free database management systems

Category:Free software programmed in Java (programming language)

Category:2016 software