Jump to content

TypeDB

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 79.173.164.66 (talk) at 09:15, 26 May 2022. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
TypeDB
Original author(s)Haikal Pribadi
Developer(s)Vaticle
Initial release9 September 2016; 8 years ago (2016-09-09)
Stable release
2.10.0 / 24 March 2022; 3 years ago (2022-03-24)[1]
Repositorygithub.com/vaticle/typedb
Written inJava[2]
Operating systemCross-platform
LicenseAGPL 3.0
Websitevaticle.com

TypeDB is an open-source, distributed, strongly-typed database with a logical type system.[3] TypeQL is its query language. TypeDB models domains based on logical and object-oriented programming principles, composed of entity, relationship, and attribute types, as well as type hierarchies, roles, and rules.

Types provide a way to describe the logical structures of your data, which allows TypeDB to validate that code inserts and queries data correctly. Query validation goes beyond static type-checking, and includes logical validation of meaningless queries. TypeDB also encodes your data for logical interpretation by a reasoning engine, and enables type-inference and rule-inference, which create logical abstractions of data. This can allow for the discovery of facts and patterns that may otherwise be hard to find.

TypeDB is developed by Vaticle Ltd. and is published under the GNU Affero General Public License. Vaticle was previously known as Grakn Labs; TypeDB as Grakn; and TypeQL as Graql.

Main features

Expressivity

Entity-Relationship Model

TypeDB allows you to model your domain using the well-known Entity-Relationship (ER) model. It is composed of entity types, relation types, and attribute types, with the introduction of role types. TypeDB allows you to leverage the full expressivity of the ER model, and describe your schema through first normal form.[4]

Type Hierarchies

TypeDB allows you to easily model type inheritance into your domain model. Following logical and object-oriented principles, TypeDB allows data types to inherit the behaviours and properties of their supertypes. Complex data structures become reusable, and data interpretation becomes richer through polymorphism.

N-ary Relations

Relations often aren't just binary connections between two things. In complicated systems, three or more things can be related with each other at once. Representing them as separate binary relationships would cause a user to lose information. TypeDB can represent an arbitrary number of things as one relation.

Nested Relations

Relations are concepts used to describe the association between two or more things. Sometimes, things can be relations themselves. TypeDB can represent such a structure, as it enables relations to be nested in another relation, allowing a user to express their system's model in a natural form.

Safety

Logical Data Validation

Inserted data gets validated beyond static type-checking of attribute value types. Entities are validated to only have the correct attributes, and relations are validated to only relate things that are logically allowed. TypeDB performs validation of inserted entities and relations by evaluating the polymorphic types of the things involved.

Logical Query Validation

Read queries executed on TypeDB go through a type resolution process. This process not only can optimise a query's execution, but also acts as a static type checker to reject meaningless and unsatisfiable queries, which are likely to be user error.

Logical inference

Rules[5]

TypeDB allows you to define rules in your schema. This extends the expressivity of a model as it enables a system to derive new conclusions when a certain logical form in a dataset is satisfied. Like functions in programming, rules can chain onto one another, creating abstractions of behaviour at the data level.

Inference

TypeDB's inference facility translates one query into all of its possible interpretations. This happens through two mechanisms: type-based inference and rule-based inference. Not only does this derive new conclusions and uncover relationships that would otherwise be hidden, but it also enables the abstraction of complex patterns into simple queries.

Architecture

TypeDB is composed of two parts: TypeDB the storage, and TypeQL the language.

TypeDB

TypeDB is a database with a rich and logical type system. Under the hood, TypeDB has built an expressive type system with a transactional query interface. TypeDB’s type system is based on hypergraph theory, a subfield in mathematics that generalises an edge to be a set of vertices.[6] The hypergraph data structure itself is represented in the form of key-value pairs and persisted on a distributed NoSQL database, RocksDB. Using the Raft algorithm, TypeDB provides a distributed system designed to be shared and replicated over a network of computers.

TypeQL

TypeQL is TypeDB’s declarative reasoning (through OLTP) query language that creates a higher level abstraction over complex relationships. TypeQL allows users to derive implicit information that is hidden in a dataset, as well as reduce the complexity of that information.

Licensing

TypeDB is available in two versions: an open source version and a commercial version (TypeDB Cluster). The open source version is available under the GNU Affero General Public License, version 3. This is free but is limited to running on one node only due to the lack of clustering and comes without security.

The commercial product, TypeDB Cluster, allows for high-availability, horizontal scalability and security.[7] TypeDB Cluster is available under a closed-source Commercial license.

References

  1. ^ "Releases · vaticle/typedb". github.com. Retrieved 2022-05-26.
  2. ^ "TypeDB System Properties".
  3. ^ Barolli, Leonard; Terzo, Olivier (2017-07-04). Complex, intelligent, and software intensive systems : proceedings of the 11th International Conference on Complex, Intelligent, and Software Intensive Systems (CISIS-2017). Cham. ISBN 9783319615660. OCLC 992988924.{{cite book}}: CS1 maint: location missing publisher (link)
  4. ^ Messina, Antonio; Pribadi, Haikal; Stichbury, Jo; Bucci, Michelangelo; Klarman, Szymon; Urso, Alfonso (2017-07-10). Complex, Intelligent, and Software Intensive Systems. Advances in Intelligent Systems and Computing. Vol. 611. Springer, Cham. pp. 299–309. doi:10.1007/978-3-319-61566-0_28. ISBN 978-3-319-61565-3.
  5. ^ "Inference in TypeDB". blog.typedb.com.
  6. ^ "Hyper-relation - UNL Wiki". www.unlweb.net.
  7. ^ "Introduction to TypeDB Cluster". blog.vaticle.com.

Bibliography

  • Malewicz, Grzegorz; Austern, Matthew H.; Bik, Aart J.C; Dehnert, James C.; Horn, Ilan; Leiser, Naty; Czajkowski, Grzegorz (2010), "Pregel: A System for Large-scale Graph Processing", Proceedings of the 2010 ACM SIGMOD International Conference on Management of Data, SIGMOD '10, New York, NY, USA: ACM: 135–146, doi:10.1145/1807167.1807184, ISBN 9781450300322, S2CID 53034533