# TypeDB Documentation > TypeDB is a polymorphic database with a conceptual data model and TypeQL, its strongly-typed query language. This index covers TypeDB 3.x. Every link below points to a Markdown version of the corresponding documentation page — prefer those over the HTML pages. Before generating any TypeQL, read [llms-full.txt](https://typedb.com/docs/llms-full.txt): a condensed summary of TypeQL 3.0 syntax and semantics, including its differences from TypeQL 2.x. ## Home - [Configure coding agent](https://typedb.com/docs/home/configure-coding-agent/index.md): Configure your AI coding agent to write valid TypeQL - [Home](https://typedb.com/docs/home/index.md): Use the cards below to learn about TypeDB, get started running TypeDB, or install TypeDB’s packages. - [Install TypeDB Community Edition](https://typedb.com/docs/home/install/ce/index.md): You can run TypeDB Community Edition (CE) locally or inside a Docker container. TypeDB CE is free & open source! - [TypeDB Cloud](https://typedb.com/docs/home/install/cloud/index.md): You can run TypeDB in the cloud without installing anything, and get started for free! - [Install TypeDB Console CLI](https://typedb.com/docs/home/install/console-cli/index.md): TypeDB Console is a standalone TypeDB client with a command line interface (CLI). It serves as a lightweight and powerful CLI tool to manage and query TypeDB databases. - [TypeDB Drivers](https://typedb.com/docs/home/install/drivers/index.md): TypeDB drivers are client libraries that enable applications to communicate with TypeDB servers. They provide a programming language-specific interface for all server operations, … - [Install TypeDB Enterprise](https://typedb.com/docs/home/install/enterprise/index.md): Run TypeDB Enterprise on your own infrastructure, a self-hosted deployment of TypeDB, fully under your control. - [Install](https://typedb.com/docs/home/install/index.md): Choose the right TypeDB distribution for your needs, or get TypeDB tools. - [TypeDB Studio](https://typedb.com/docs/home/install/studio/index.md): TypeDB Studio is an interactive visual environment for managing and querying TypeDB databases. - [Install TypeQL Syntax Checker](https://typedb.com/docs/home/install/typeql-check/index.md): typeql-check is a small CLI tool that validates the syntax of a TypeQL query without sending it to a TypeDB server. It is useful for linting .tql files in editors and CI … - [Learning journey](https://typedb.com/docs/home/learning-journey/index.md): Welcome to our guide on how to best leverage these docs for learning TypeDB and TypeQL. It is designed to take you from being a beginner to an advanced user through a structured … - [What is TypeDB?](https://typedb.com/docs/home/what-is-typedb/index.md): Welcome to the world of TypeDB, a new kind of database designed to help you model and query data with clarity and confidence. - [Why TypeDB?](https://typedb.com/docs/home/why-typedb/index.md): TypeDB offers developers a new way to manage their data, with simplicity, safety, and expressivity at the forefront. ## Learn TypeDB - [Learn TypeDB](https://typedb.com/docs/learn-typedb/index.md): Learn TypeDB and TypeQL through hands-on guides and courses. - [Create data](https://typedb.com/docs/learn-typedb/quickstart/data/index.md): Use queries to load data into your database - [Quickstart: Basics](https://typedb.com/docs/learn-typedb/quickstart/index.md): Get started with TypeDB and TypeQL - [Overview](https://typedb.com/docs/learn-typedb/quickstart/overview/index.md): Overview of the Quickstart guide - [Query composition](https://typedb.com/docs/learn-typedb/quickstart/query-composition/index.md): Chain clauses into queries and write reusable functions - [Create a schema](https://typedb.com/docs/learn-typedb/quickstart/schema/index.md): Create a database and initialize the schema - [Setup](https://typedb.com/docs/learn-typedb/quickstart/setup/index.md): Start running TypeDB and open TypeDB Studio - [Chapter Zero: Get Started in TypeDB Studio](https://typedb.com/docs/learn-typedb/rbac-in-business/00-get-started-studio/index.md): Setting up your environment before your first query. - [Chapter One: The Identity Registry](https://typedb.com/docs/learn-typedb/rbac-in-business/01-identity-registry/index.md): Entities, attributes, and your first schema. - [Chapter Two: The Identity Management System](https://typedb.com/docs/learn-typedb/rbac-in-business/02-identity-model/index.md): Type hierarchies, relations, and the org structure. - [Chapter Three: Populating Amasoft](https://typedb.com/docs/learn-typedb/rbac-in-business/03-populating-amasoft/index.md): Insert, match, and fetch - the pattern language. - [Chapter Four: Granting Access](https://typedb.com/docs/learn-typedb/rbac-in-business/04-granting-access/index.md): The access model, @values, and permission queries. - [Chapter Five: Levels & Promotions](https://typedb.com/docs/learn-typedb/rbac-in-business/05-levels-and-promotions/index.md): Level assignment and two organisational changes. - [Chapter Six: The Access Audit](https://typedb.com/docs/learn-typedb/rbac-in-business/06-access-audit/index.md): Operators, pipelines, aggregation, and compliance queries. - [Chapter Seven: Access Policies as Functions](https://typedb.com/docs/learn-typedb/rbac-in-business/07-policies-as-functions/index.md): Enshrining Amasoft's policies in reusable code - [Chapter Eight: Accountable Access](https://typedb.com/docs/learn-typedb/rbac-in-business/08-accountable-access/index.md): Policy grants, exceptions, and access reviews - why every grant exists. - [Chapter Nine: Production RBAC](https://typedb.com/docs/learn-typedb/rbac-in-business/09-production-rbac/index.md): Transactions, drivers, schema migrations, and idempotent pipelines. - [Epilogue: You Are the Architect](https://typedb.com/docs/learn-typedb/rbac-in-business/10-epilogue/index.md): You have completed RBAC In Business - and built a production-grade foundation. - [TypeDB crash course: RBAC in Business](https://typedb.com/docs/learn-typedb/rbac-in-business/index.md): Learn TypeDB in this short crash course - build Amasoft's role-based access control system in TypeQL, from first schema to production-grade audit queries. ## TypeDB Academy - [Lesson 1: Introduction to TypeDB](https://typedb.com/docs/academy/1-introduction-to-typedb/index.md): The fast advances of modern, high-level declarative programming models in parallel with the rise of distributed and multithreaded systems make it harder and harder to continue … - [Lesson 10.1: Functions as views](https://typedb.com/docs/academy/10-using-functions/10.1-functions-as-views/index.md): In Lesson 5.4, we learned how to define functions for TypeDB’s to capture subqueries and abstract away reusable ideas. In this lesson, we’ll learn how to design function that … - [Lesson 10.2: Function chaining](https://typedb.com/docs/academy/10-using-functions/10.2-function-chaining/index.md): Much like views in a relational database, which can be generated from other views, functions in TypeDB can leverage answers generated by other functions. - [Lesson 10: Using inference](https://typedb.com/docs/academy/10-using-functions/index.md): In this lesson, we’ll learn how to write and use functions effectively. We’ll start by seeing functions can be used like views in order to abstract complex query patterns into … - [Lesson 10: Using inference](https://typedb.com/docs/academy/10-using-functions/summary/index.md): Functions are can be treated like SQL views - they abstract away queries into a different format - [Lesson 11.1: Using dependent types](https://typedb.com/docs/academy/11-advanced-modeling/11.1-using-dependent-types/index.md): The PERA model and TypeQL are both based on the theory of dependent types. Though we have previously taken advantage of polymorphic features in the model and language, we have not … - [Lesson 11.2: Using type-theoretic relations](https://typedb.com/docs/academy/11-advanced-modeling/11.2-using-type-theoretic-relations/index.md): In the previous lesson, we learned how to map application types onto database types using the type-theoretic framework of the PERA model. In this lesson, we’ll explore how our … - [Lesson 11.3: Reifying interfaces](https://typedb.com/docs/academy/11-advanced-modeling/11.3-reifying-interfaces/index.md): In Lesson 11.1, we saw how references between object types can be stored either as relation types or as role types, as illustrated in the following examples. - [Lesson 11: Advanced modeling](https://typedb.com/docs/academy/11-advanced-modeling/index.md): In this lesson, we’ll learn how to use the PERA model to design TypeDB schemas that eliminate mismatch with application models. We’ll begin by reviewing the fundamentals of the … - [Lesson 11: Advanced modeling](https://typedb.com/docs/academy/11-advanced-modeling/summary/index.md): Entity and relation types can be treated as implementations of object types with a zero or non-zero number of dependencies respectively. - [Lesson 2.1: Sample deployment](https://typedb.com/docs/academy/2-environment-setup/2.1-sample-deployment/index.md): There are two simple ways to get the bookstore sample dataset that is used throughout this academy. - [Lesson 2: Environment setup](https://typedb.com/docs/academy/2-environment-setup/index.md): In this lesson, we’ll set up the environment needed to work through this course. We’ll begin by downloading and running a Docker image that will deploy a TypeDB Community Edition … - [Lesson 3.1: Fetching simple data](https://typedb.com/docs/academy/3-reading-data/3.1-fetching-simple-data/index.md): To begin with, we’ll use the following Fetch query to retrieve all data relating to paperback book entities in the database. - [Lesson 3.2: Fetching polymorphic data](https://typedb.com/docs/academy/3-reading-data/3.2-fetching-polymorphic-data/index.md): In the previous lesson, we retrieved the titles and page counts of paperback books with the following query. - [Lesson 3.3: Using functions](https://typedb.com/docs/academy/3-reading-data/3.3-using-functions/index.md): Try running the following query, which retrieves a particular user’s location. - [Lesson 3.4: Fetching schema types](https://typedb.com/docs/academy/3-reading-data/3.4-fetching-schema-types/index.md): So far, we’ve seen that the output of Fetch queries includes a type field for every retrieved data instance and their attributes. However, there are also types involved in the … - [Lesson 3.5: Query validation](https://typedb.com/docs/academy/3-reading-data/3.5-query-validation/index.md): TypeQL’s composability provides a natural syntax for building queries, but not all queries are valid. Try running the following queries. Only the first one will be successfully … - [Lesson 3: Reading data](https://typedb.com/docs/academy/3-reading-data/index.md): In this lesson, we’ll learn how to read pre-inserted data in the sample database using Fetch queries. We’ll begin by seeing how we can retrieve entities and relations in a similar … - [Lesson 3: Reading data](https://typedb.com/docs/academy/3-reading-data/summary/index.md): Fetch queries are used to retrieve data in JSON format. They comprise a match clause and fetch clause. - [Lesson 4.1: Inserting simple data](https://typedb.com/docs/academy/4-writing-data/4.1-inserting-simple-data/index.md): To insert new data into a database, we use an Insert clause. The following query inserts a new user. - [Lesson 4.2: Inserting polymorphic data](https://typedb.com/docs/academy/4-writing-data/4.2-inserting-polymorphic-data/index.md): In the previous lesson, we saw how we could use match clauses in Insert queries in order to have new data reference existing data. In this lesson, we’ll see how we can use that … - [Lesson 4.3: Deleting data](https://typedb.com/docs/academy/4-writing-data/4.3-deleting-data/index.md): To delete data from the database, we use a delete clause. Delete clauses always follow some preceding query clauses. The way we write Delete queries depends on if we want to … - [Lesson 4.4: Updating data](https://typedb.com/docs/academy/4-writing-data/4.4-updating-data/index.md): To update the values of attributes, we use chain Delete and Insert clauses. In effect, these queries delete an existing attribute of an entity (or relation) and then inserts a new … - [Lesson 4.5: Data validation](https://typedb.com/docs/academy/4-writing-data/4.5-data-validation/index.md): In Lesson 3.5, we saw that TypeDB validates all read queries against the schema to ensure semantic correctness. Likewise, all write queries are also validated to ensure data … - [Lesson 4: Writing data](https://typedb.com/docs/academy/4-writing-data/index.md): In this lesson, we’ll learn how to write data to the sample database using Insert queries, Delete queries, and Update queries. We’ll explore examples of both simple and … - [Lesson 4: Writing data](https://typedb.com/docs/academy/4-writing-data/summary/index.md): Insert clauses are used to insert data. They can be used alone, using just an insert clause, or after any other sequence of clauses, such as a match clause. Inserts are run using … - [Lesson 5.1: Defining individual types](https://typedb.com/docs/academy/5-defining-schemas/5.1-defining-individual-types/index.md): In TypeDB, all databases have a schema that provides semantic integrity guarantees for inserted data and enables the resolution of polymorphic queries. A schema is created using … - [Lesson 5.2: Defining type hierarchies](https://typedb.com/docs/academy/5-defining-schemas/5.2-defining-type-hierarchies/index.md): To define type hierarchies, we use the same Define queries as when defining individual types. The following query shows how we can define a hierarchy of book types. - [Lesson 5.3: Defining data constraints](https://typedb.com/docs/academy/5-defining-schemas/5.3-defining-constraints/index.md): The most important type of data constraint is configuring cardinality. Cardinality indicates how many times a connection is allowed between instances of a type. - [Lesson 5.4: Defining functions](https://typedb.com/docs/academy/5-defining-schemas/5.4-defining-functions/index.md): In Lesson 3.3, we saw how we could use functions to modularize and re-use computation. In this lesson, we’ll see how we can go about defining these functions. Functions are … - [Lesson 5.5: Schema validation](https://typedb.com/docs/academy/5-defining-schemas/5.5-schema-validation/index.md): In order to maintain integrity, the schema is validated to ensure internal consistency upon each change. Some of the checks that take place during validation are: - [Lesson 5: Defining schemas](https://typedb.com/docs/academy/5-defining-schemas/index.md): In this lesson, we’ll learn how to define entity, relation, and attribute types using Define queries. We’ll start by defining individual types and their interfaces, namely … - [Lesson 5: Defining schemas](https://typedb.com/docs/academy/5-defining-schemas/summary/index.md): Define queries are used to define new types, interfaces, and functions. They comprise a define clause only. Define queries are run schema transaction. - [Lesson 6.1: Driver Overview](https://typedb.com/docs/academy/6-building-applications/6.1-driver-overview/index.md): TypeDB Drivers are available in two flavors: using the GRPC endpoint or using the HTTP endpoint. - [Lesson 6.2: Managing databases](https://typedb.com/docs/academy/6-building-applications/6.2-managing-users-and-databases/index.md): TypeDB Studio manages the connection automatically. With native drivers, instantiate a driver object and open transactions directly. - [Lesson 6.3: Transactions](https://typedb.com/docs/academy/6-building-applications/6.3-transactions/index.md): With a connection established to the server via a driver, open transactions directly against a database. There are three transaction kinds: READ, WRITE, and SCHEMA. - [Lesson 6.4: Executing queries](https://typedb.com/docs/academy/6-building-applications/6.4-executing-queries/index.md): Now that we know how to instantiate driver objects and open transactions, we can begin running queries. We’ll begin with the following Fetch query. - [Lesson 6.5: Processing results](https://typedb.com/docs/academy/6-building-applications/6.5-processing-results/index.md): In this lesson, we’ll be looking at how we can process the results of queries to produce the data structures we need. We’ll start with the following query. - [Lesson 6: Building applications](https://typedb.com/docs/academy/6-building-applications/index.md): In this lesson, we’ll learn how to use the TypeDB native language drivers to build applications on TypeDB. We’ll start by seeing how to manage databases, then learn to use … - [Lesson 6: Building applications](https://typedb.com/docs/academy/6-building-applications/summary/index.md): The official TypeDB Python driver package can be installed with: - [Lesson 7.1: Patterns as constraints](https://typedb.com/docs/academy/7-understanding-query-patterns/7.1-patterns-as-constraints/index.md): TypeQL uses pattern matching as the basis for all data queries. We have seen in previous lessons how almost all queries have a match clause. The content of a match clause is a … - [Lesson 7.2: Relation patterns](https://typedb.com/docs/academy/7-understanding-query-patterns/7.2-relation-patterns/index.md): We initially learned how to use TypeQL’s tuple syntax to represent relations in Lesson 3.1. In this lesson, we will cover the many flexible ways that TypeQL allows us to format … - [Lesson 7.3: Logical operators](https://typedb.com/docs/academy/7-understanding-query-patterns/7.3-logical-operators/index.md): By default, all statements in a pattern are joined in a conjunction. As we have seen in Lesson 7.1, this means that the pattern must be satisfied as a set of simultaneous … - [Lesson 7.4: Value comparisons](https://typedb.com/docs/academy/7-understanding-query-patterns/7.4-value-comparisons/index.md): TypeQL provides several operators for comparing the values of attributes and literals in patterns. - [Lesson 7.5: Value expressions](https://typedb.com/docs/academy/7-understanding-query-patterns/7.5-value-expressions/index.md): Expressions are used to compute new values or capture the result of function calls as a new variable. - [Lesson 7.6: Solution set semantics](https://typedb.com/docs/academy/7-understanding-query-patterns/7.6-solution-set-semantics/index.md): In Lesson 7.1, we learned how patterns in TypeQL queries are resolved as a set of simultaneous constraints. With that in mind, let’s consider the following Fetch query, which is … - [Lesson 7: Understanding query patterns](https://typedb.com/docs/academy/7-understanding-query-patterns/index.md): In this lesson, we’ll learn advanced aspects of building query patterns. We’ll begin by examining how TypeDB resolves patterns against the schema as constraint satisfaction … - [Lesson 7: Understanding query patterns](https://typedb.com/docs/academy/7-understanding-query-patterns/summary/index.md): A pattern comprises a conjunction of any number of consecutive statements. - [Lesson 8.1: Chaining clauses](https://typedb.com/docs/academy/8-composing-clauses/8.1-chaining-clauses/index.md): In every lesson, we’ve used different query clauses: match, insert, delete, update. We have also used query operators, that don’t touch the database, like limit. And, we’ve … - [Lesson 8.3: Aggregations](https://typedb.com/docs/academy/8-composing-clauses/8.2-aggregations/index.md): Suppose that we want to count the promotions each book is in rather than listing them all out by name. To do so, we can use an aggregation, as in the following query. - [Lesson 8.4: Sorting and pagination](https://typedb.com/docs/academy/8-composing-clauses/8.3-sorting-and-pagination/index.md): The results of any query can be sorted by adding the sort modifier to the query. The following query retrieves the list of every book’s title and page count, and sorts by page … - [Lesson 8.2: Subqueries](https://typedb.com/docs/academy/8-composing-clauses/8.4-subqueries/index.md): The best way to do subqueries in TypeQL is with functions (though we’ll see how to use fetch for similar purposes in the next lesson). - [Lesson 8.5: Structured fetching](https://typedb.com/docs/academy/8-composing-clauses/8.5-structured-fetching/index.md): TypeQL’s fetch clause is quite powerful! Let’s look a little deeper at what it can do. One underlying idea is that every part of the fetch clause must use serializable types - … - [Lesson 8: Composing clauses](https://typedb.com/docs/academy/8-composing-clauses/index.md): In this lesson, we’ll learn how we can compose clauses to build queries into longer pipelines, and to to retrieve results in more useful structures using advanced fetch clause … - [Lesson 8: Structuring query results](https://typedb.com/docs/academy/8-composing-clauses/summary/index.md): Clauses can be chained arbitrarily into query pipelines, since they all consume streams of concept rows and produce stream of concept rows - [Lesson 9.1: The PERA model](https://typedb.com/docs/academy/9-modeling-schemas/9.1-the-pera-model/index.md): In database design, there are normally three separate models for a database: the conceptual, logical, and physical models. - [Lesson 9.2: Determining object types](https://typedb.com/docs/academy/9-modeling-schemas/9.2-determining-object-types/index.md): Data might come from a variety of sources, from tabulated data files to real-time data streams from microservices. In this lesson, we’ll examine how we might go about modeling … - [Lesson 9.3: Avoiding data redundancies](https://typedb.com/docs/academy/9-modeling-schemas/9.3-avoiding-data-redundancies/index.md): In the previous lesson, we created a first iteration of a data model for book data. In this lesson, we’ll see how we can eliminate data redundancies generated by the model. - [Lesson 9.4: Using type hierarchies](https://typedb.com/docs/academy/9-modeling-schemas/9.4-using-type-hierarchies/index.md): In the previous two lessons, we created and developed a data model for book data. In this lesson, we’ll see how we can introduce type hierarchies into the model so that we can … - [Lesson 9.5: Composition over inheritance](https://typedb.com/docs/academy/9-modeling-schemas/9.5-composition-over-inheritance/index.md): In the previous lesson, we introduced type hierarchies into the data model for our book data. In this lesson, we’ll examine a case where composition is a better approach than … - [Lesson 9.6: Using interface hierarchies](https://typedb.com/docs/academy/9-modeling-schemas/9.6-using-interface-hierarchies/index.md): In the previous lesson, we improved the type hierarchies in our book data model by using the principle of composition over inheritance. In this lesson, we’ll explore the behaviour … - [Lesson 9.7: Avoiding interface redundancies](https://typedb.com/docs/academy/9-modeling-schemas/9.7-avoiding-interface-redundancies/index.md): In the previous lesson, we learned how to use interface hierarchies in our schema to achieve different behaviours. In this lesson, we’ll see how having multiple interfaces that … - [Lesson 9.8: Interface constracts](https://typedb.com/docs/academy/9-modeling-schemas/9.8-abstract-contracts/index.md): Abstractness allows you to build forms of contracts on types, with more forms of contracts to be allowed in the future. - [Lesson 9.9: Specialization](https://typedb.com/docs/academy/9-modeling-schemas/9.9-specialization/index.md): Most of the time, TypeDB will reject redeclarations of identical schema definitions when the same definition is already applicable via inheritance. However, it is possible to … - [Lesson 9: Modeling schemas](https://typedb.com/docs/academy/9-modeling-schemas/index.md): In this lesson, we’ll learn how to design TypeDB schemas using the conceptual PERA data model. We’ll start with an overview of the PERA model and see how it is implemented by … - [Lesson 9: Modeling schemas](https://typedb.com/docs/academy/9-modeling-schemas/summary/index.md): A PERA data model comprises data-storing types and interface types between them, similar to classes and interfaces in OOP. Interface types serve as abstractions of the … - [TypeDB Academy](https://typedb.com/docs/academy/index.md): Welcome to TypeDB Academy! ## Core Concepts - [Analyzing queries](https://typedb.com/docs/core-concepts/drivers/analyze/index.md): Compiling & analyzing TypeDB queries. - [Users & Authentication](https://typedb.com/docs/core-concepts/drivers/authentication/index.md): Understanding authentication with TypeDB drivers. - [Best Practices](https://typedb.com/docs/core-concepts/drivers/best-practices/index.md): Best practices for building robust applications with TypeDB drivers. - [Connections](https://typedb.com/docs/core-concepts/drivers/connections/index.md): How to establish and manage connections to TypeDB servers. - [Drivers](https://typedb.com/docs/core-concepts/drivers/index.md): Gain a deeper understanding of TypeDB drivers. - [Overview](https://typedb.com/docs/core-concepts/drivers/overview/index.md): Overview of TypeDB drivers and their conceptual model. - [Queries](https://typedb.com/docs/core-concepts/drivers/queries/index.md): Executing TypeQL queries and processing results with TypeDB drivers. - [Transactions](https://typedb.com/docs/core-concepts/drivers/transactions/index.md): Understanding transaction types, lifecycle, and patterns with TypeDB drivers. - [Core Concepts](https://typedb.com/docs/core-concepts/index.md): Explore the core concepts of TypeDB, including the server and TypeQL language. - [Connections](https://typedb.com/docs/core-concepts/typedb/connections/index.md): To interact with a TypeDB database, a client application must first establish a connection to the server. This is typically done using a TypeDB driver for your chosen programming … - [CRUD](https://typedb.com/docs/core-concepts/typedb/crud/index.md): CRUD operations create, read, update, and delete data in the TypeDB database. - [Databases](https://typedb.com/docs/core-concepts/typedb/databases/index.md): This section covers the management of databases and the definition of the schema, which provides the structural foundation for your data. - [Errors](https://typedb.com/docs/core-concepts/typedb/errors/index.md): Errors in TypeDB keep track of their cause, and the location of the error in the query. Console and Studio will display the full stck from the lowest level cause, such as a TypeQL … - [Horizontal Scaling](https://typedb.com/docs/core-concepts/typedb/horizontal-scaling/index.md): When a single server can no longer handle the volume of read queries for your application, it becomes necessary to scale out horizontally. In TypeDB, this is achieved by creating … - [TypeDB](https://typedb.com/docs/core-concepts/typedb/index.md): Gain a deeper understanding of TypeDB Server. - [TypeDB Server Overview](https://typedb.com/docs/core-concepts/typedb/overview/index.md): This section of the documentation covers the architecture and design of TypeDB. - [Transactions](https://typedb.com/docs/core-concepts/typedb/transactions/index.md): Every TypeDB query runs inside a transaction. - [Users](https://typedb.com/docs/core-concepts/typedb/users/index.md): TypeDB authenticates via login with a username and password. - [Vertical Scaling](https://typedb.com/docs/core-concepts/typedb/vertical-scaling/index.md): Vertical scaling, or "scaling up," boils down to adding more resources to a single server to increase its capacity. This is often the simplest way to handle increased load, as it … - [Constraining Data](https://typedb.com/docs/core-concepts/typeql/constraining-data/index.md): TypeDB allows additional constraints to be defined on the types in the schema. These constraints can restrict the cardinality of an interface, or the domain of values of an … - [Entities, Relations, Attributes](https://typedb.com/docs/core-concepts/typeql/entities-relations-attributes/index.md): TypeDB implements the Polymorphic Entity-Relation-Attribute (PERA) data model. A TypeDB schema defines a hierarchy of these types and how they interact with each other through … - [Functions](https://typedb.com/docs/core-concepts/typeql/functions/index.md): TypeQL function provides a way to create abstractions over existing data, allowing queries to be expressed at a higher level. They can live in your schema - as a "library" your … - [Glossary](https://typedb.com/docs/core-concepts/typeql/glossary/index.md): This page lists out terms reused across pages in this section, and links to where they are introduced. A more complete list can be found in the TypeQL reference. - [TypeQL](https://typedb.com/docs/core-concepts/typeql/index.md): TypeQL is the declarative, strongly-typed, and intuitive query language used by TypeDB. - [Advanced: Invalid Patterns](https://typedb.com/docs/core-concepts/typeql/invalid-patterns/index.md): This section dives into the semantics of TypeQL, using the Disjunctive Normal Form to explain why Disjoint variable reuse makes a pattern invalid. - [Overview](https://typedb.com/docs/core-concepts/typeql/overview/index.md) - [Query Clauses & Pipelining](https://typedb.com/docs/core-concepts/typeql/query-clauses/index.md): In addition to the match clause for pattern matching and the insert, delete, put, update clauses for modifying data, TypeQL has a number of other clauses supporting operations … - [Query Variables and Patterns](https://typedb.com/docs/core-concepts/typeql/query-variables-patterns/index.md): TypeQL is a declarative language: it focuses on describing the schema, data, or query through patterns, rather than specifying how to perform the query. - [Schema & Data](https://typedb.com/docs/core-concepts/typeql/schema-data/index.md): As seen in the Entities, Relations, Attributes page, a TypeDB schema defines a hierarchy of types, their associated interfaces and interfaces they implement. ## Guides - [Guides](https://typedb.com/docs/guides/index.md): In this section, you will find guides for accomplishing specific TypeDB tasks. - [Deploy TypeDB via the Cloud API](https://typedb.com/docs/guides/integrations/deploy-through-api/index.md): A guide on deploying TypeDB through the API - [Graph Visualisation for TypeDB Data](https://typedb.com/docs/guides/integrations/graph-viz/index.md) - [Integrations](https://typedb.com/docs/guides/integrations/index.md): In this section, you will find guides for integrating TypeDB with other tools, platforms and workflows. - [AI Agents persistence with LangGraph and TypeDB](https://typedb.com/docs/guides/integrations/langgraph/index.md): Use the TypeDB plugin for LangGraph to persist agent state and long-term memory. - [Full Stack Application - Social Network](https://typedb.com/docs/guides/integrations/social-network/index.md): A simple example application in multiple languages. - [Use TypeDB in GitHub Actions](https://typedb.com/docs/guides/integrations/use-github-actions/index.md): A guide on using the TypeDB in GitHub Actions - [Schema modeling](https://typedb.com/docs/guides/schema-modeling/index.md): Design TypeDB schemas - entities vs relations vs attributes, naming, composition, type safety, cardinality, value, and role constraints, and functions. - [Advanced query pipelines](https://typedb.com/docs/guides/typeql/advanced-pipelines/index.md): In this guide, we will explore some more complex pipelines and patterns in TypeQL. - [Debugging TypeQL](https://typedb.com/docs/guides/typeql/debugging-typeql/index.md): Learn how to leverage TypeQL's composability to quickly debug queries and pipelines. - [TypeQL](https://typedb.com/docs/guides/typeql/index.md): This section contains guides for TypeQL, TypeDB query language. - [Inserting and updating data](https://typedb.com/docs/guides/typeql/insert-update-data/index.md): This guide covers the basics of inserting and updating data in TypeDB. - [Optimizing TypeQL](https://typedb.com/docs/guides/typeql/optimizing-typeql/index.md): Learn how TypeDB's optimizer works and how to write efficient TypeQL queries. - [Reading data](https://typedb.com/docs/guides/typeql/read-data/index.md): This guide covers the common patterns of read queries in TypeQL. - [Understanding SQL vs. TypeQL](https://typedb.com/docs/guides/typeql/sql-vs-typeql/index.md): This guide helps SQL users understand TypeQL by mapping familiar SQL constructs to their TypeQL equivalents. ## Use Cases - [Artificial Intelligence](https://typedb.com/docs/use-cases/ai/index.md): TypeDB’s rich modeling language empowers AI-powered applications by capturing the complex and interconnected nature of real-world data. Its expressive schema and powerful query … - [Cybersecurity](https://typedb.com/docs/use-cases/cybersecurity/index.md): TypeDB’s polymorphic data model makes it a natural fit for cyber threat intelligence, where threats, actors, indicators, and infrastructure form a deeply interconnected graph that … - [Graph database](https://typedb.com/docs/use-cases/graph/index.md): How TypeDB works as a more advanced graph database - [Hypergraph database](https://typedb.com/docs/use-cases/hypergraph/index.md): How TypeDB's hypergraph model handles n-ary relations, nested relations, and layered context and metadata structuresg - [IAM](https://typedb.com/docs/use-cases/iam/index.md): TypeDB is an excellent database to model identity control, resources and permission systems. - [Use Cases](https://typedb.com/docs/use-cases/index.md): Explore real-world use cases for TypeDB. - [Robotics](https://typedb.com/docs/use-cases/robotics/index.md): TypeDB’s ability to model complexity is extremely useful in robotics, where worlds, datasets and interactions can be extremely heterogenous. ## Tools - [TypeDB Admin Tool](https://typedb.com/docs/tools/admin/index.md): Local CLI for inspecting and managing a running TypeDB server. - [TypeDB Console](https://typedb.com/docs/tools/console/index.md): TypeDB Console is a standalone TypeDB client with a command line interface (CLI). It serves as a lightweight and powerful CLI tool to manage and query TypeDB databases. - [IDE Plugins](https://typedb.com/docs/tools/ide-plugins/index.md): There are some plugins available, written by the TypeDB community. Since they are not currently officially supported, they are not guaranteed to be up-to-date with the latest … - [Tools](https://typedb.com/docs/tools/index.md): Explore the tools available for working with TypeDB. - [TypeDB Loader](https://typedb.com/docs/tools/loader/index.md): This section provides information on using the TypeDB Loader. It includes reference documentation, as well as specific example walkthroughs of using the loader. - [JSON to TypeDB](https://typedb.com/docs/tools/loader/json-example/index.md): This walkthrough takes a nested JSON dataset, designs a schema to fit it, normalizes it into CSVs, and loads it with the TypeDB Loader. The loader itself only consumes CSV, so the … - [Quickstart](https://typedb.com/docs/tools/loader/quickstart/index.md): A CSV-driven bulk loader for TypeDB. Each CSV row is bound to the variables of a TypeQL query template and submitted in batches over write transactions, with checkpointing, … - [TypeDB Loader Reference](https://typedb.com/docs/tools/loader/reference/index.md): Reference for every command-line flag accepted by the TypeDB Loader, grouped by topic. - [Migrating a SQL Database](https://typedb.com/docs/tools/loader/sql-example/index.md): This walkthrough takes a small relational schema, remodels it for TypeDB, and loads it end-to-end with the TypeDB Loader. The modelling shift is brief; the bulk of the work is one … - [TypeDB MCP Server](https://typedb.com/docs/tools/mcp-server/index.md): TypeDB MCP Server is an MCP (Model Context Protocol) server that enables AI assistant tools and autonomous agents to interact with TypeDB databases. It provides structured access … - [TypeDB Studio](https://typedb.com/docs/tools/studio/index.md): TypeDB Studio is an interactive visual environment for managing and querying TypeDB databases. - [TypeDB Cloud API](https://typedb.com/docs/tools/typedb-cloud-api/index.md): The TypeDB Cloud administration API can be used to perform certain actions programmatically, rather than through the TypeDB Cloud website. - [TypeQL Syntax Checker](https://typedb.com/docs/tools/typeql-check/index.md): CLI tool for validating TypeQL query syntax. ## Maintenance & Operation - [Database Export & Import](https://typedb.com/docs/maintenance-operation/database-export-import/index.md): Use TypeDB’s built-in export functionality to export a database as a complete TypeQL schema file and a binary containing the instances in the database. - [Diagnostics monitoring endpoint](https://typedb.com/docs/maintenance-operation/diagnostics-endpoint/index.md): HTTP endpoint for scraping TypeDB server metrics in Prometheus or JSON format. - [Maintenance & Operation](https://typedb.com/docs/maintenance-operation/index.md): Learn how to maintain and operate TypeDB servers. - [Connecting](https://typedb.com/docs/maintenance-operation/troubleshooting/connection/index.md): This page contains the most common issues that may be encountered during development with respect to connecting to a TypeDB server. - [Troubleshooting](https://typedb.com/docs/maintenance-operation/troubleshooting/index.md): This section provides general recommendations and solutions to common issues faced while interacting with TypeDB. - [Installation](https://typedb.com/docs/maintenance-operation/troubleshooting/installation/index.md): The server does not start with error version 'GLIBC_2.25' not found - [Stopping queries](https://typedb.com/docs/maintenance-operation/troubleshooting/stopping-queries/index.md): If a query runs indefinitely, you may need to stop it. This page provides general guidelines for safely terminating queries in different TypeDB clients. - [TypeDB Backups](https://typedb.com/docs/maintenance-operation/typedb-backups/index.md): This documentation covers the backup solutions available for TypeDB, both in the Cloud and Self-hosted CE and Enterprise deployments. - [TypeDB Configuration](https://typedb.com/docs/maintenance-operation/typedb-configuration/index.md): TypeDB Server configuration. - [TypeDB In-flight Encryption](https://typedb.com/docs/maintenance-operation/typedb-in-flight-encryption/index.md): Communication with a TypeDB server can be secured using TLS. TLS serves two purposes: - [TypeDB Upgrades](https://typedb.com/docs/maintenance-operation/typedb-upgrades/index.md): There are two mechanisms in which data can be preserved during a server version upgrade: ## TypeQL Reference - [@abstract annotation](https://typedb.com/docs/typeql-reference/annotations/abstract/index.md): The @abstract annotation is used to specify that a type is abstract. - [@card annotation](https://typedb.com/docs/typeql-reference/annotations/card/index.md): The @card annotation is used to specify cardinality ranges for roles and ownerships. - [@cascade annotation](https://typedb.com/docs/typeql-reference/annotations/cascade/index.md): The @cascade annotation is a planned feature and not yet available in TypeDB. Coming soon! - [@distinct annotation](https://typedb.com/docs/typeql-reference/annotations/distinct/index.md): The @distinct annotation is used to restrict an owned list of attributes to distinct values. - [@doc annotation](https://typedb.com/docs/typeql-reference/annotations/doc/index.md): The @doc annotation is used to add a description to a schema concept. - [@independent annotation](https://typedb.com/docs/typeql-reference/annotations/independent/index.md): The @independent annotation is used to prevent attributes without owners from being deleted automatically. - [Annotations](https://typedb.com/docs/typeql-reference/annotations/index.md): Annotations are useful language constructs that begin with an @. They can be used to enforce constraints on definitions. - [@key annotation](https://typedb.com/docs/typeql-reference/annotations/key/index.md): The @key annotation is used to specify key attributes for entities and relations. - [@meta annotation](https://typedb.com/docs/typeql-reference/annotations/meta/index.md): The @meta annotation is used to add metadata to a schema concept. - [@range annotation](https://typedb.com/docs/typeql-reference/annotations/range/index.md): The @range annotation is used to specify a range of permitted values for attributes. - [@regex annotation](https://typedb.com/docs/typeql-reference/annotations/regex/index.md): The @regex annotation is used to specify a regex pattern for permitted values of attributes. - [@subkey annotation](https://typedb.com/docs/typeql-reference/annotations/subkey/index.md): The @subkey annotation is a planned feature and not yet available in TypeDB. Coming soon! - [@unique annotation](https://typedb.com/docs/typeql-reference/annotations/unique/index.md): The @unique annotation is used to specify unique attributes for entities and relations. - [@values annotation](https://typedb.com/docs/typeql-reference/annotations/values/index.md): The @values annotation is used to specify a set of permitted values for attributes. - [Data and query model](https://typedb.com/docs/typeql-reference/data-model/index.md): This page gives a brief technical overview of TypeDB’s type system and query model. - [Built-in functions](https://typedb.com/docs/typeql-reference/expressions/builtin-functions/index.md): Returns the internal ID of the provided instance argument as a string. The result is intended to be used in an iid predicate in future queries to uniquely identify the instance. … - [Function calls](https://typedb.com/docs/typeql-reference/expressions/function-calls/index.md): A function call expression consists of a function name, followed by comma-separated arguments enclosed in parentheses. - [Expressions](https://typedb.com/docs/typeql-reference/expressions/index.md): A TypeQL expression uses operators and functions to compute a value from other values. It uses the following syntax: - [Lists](https://typedb.com/docs/typeql-reference/expressions/lists/index.md): Lists are a planned feature and not yet available in TypeDB. Coming soon! - [Literals](https://typedb.com/docs/typeql-reference/expressions/literals/index.md): A literal is a value written directly into a query, rather than retrieved from the database or computed from other values. Every literal is a constant of a single value type. The … - [Structs](https://typedb.com/docs/typeql-reference/expressions/structs/index.md): Structs are a planned feature and not yet available in TypeDB. Coming soon! - [Value operations](https://typedb.com/docs/typeql-reference/expressions/value-operations/index.md): Arithmetic operator expressions allow computation of new values. Attributes are treated as pure values when used in an arithmetic operator expression. - [Functions v/s rules](https://typedb.com/docs/typeql-reference/functions/functions-vs-rules/index.md): TypeDB 3 introduces functions to reason over your data. They replace rules, which were the way to reason in TypeDB 2. Functions work in a similar way to rules, providing an … - [Functions](https://typedb.com/docs/typeql-reference/functions/index.md): Functions provide powerful abstractions of query logic. They are a cornerstone of the functional query programming model, and generalize logic programs à la Datalog. Functions … - [Scalar and tuple functions](https://typedb.com/docs/typeql-reference/functions/scalar/index.md): Scalar and tuple functions are function types which return at most one row of outputs. - [Stream functions](https://typedb.com/docs/typeql-reference/functions/stream/index.md): Stream functions are function types which return zero or more output rows. - [Writing functions](https://typedb.com/docs/typeql-reference/functions/writing/index.md): Functions in TypeQL are declared using the keyword fun. A function declaration consists of: - [TypeQL language guide](https://typedb.com/docs/typeql-reference/index.md): This page gives an overview of the TypeQL query language. For an overview of the data model on which TypeQL queries are built see here. - [Keyword glossary](https://typedb.com/docs/typeql-reference/keywords/index.md): Denotes the beginning of a Define query, used to add new types, constraints, or functions to the schema. - [Conjunctions](https://typedb.com/docs/typeql-reference/patterns/conjunctions/index.md): A conjunction of patterns requires all its constituent patterns to match its concepts. It is most commonly encountered as the body of a match clause. - [Disjunctions](https://typedb.com/docs/typeql-reference/patterns/disjunctions/index.md): Disjunctive patterns can be used in match stages. They allow queries to match several cases (or “branches”) of patterns in parallel. - [Patterns](https://typedb.com/docs/typeql-reference/patterns/index.md): This reference covers the usage of patterns in TypeQL. - [Negations](https://typedb.com/docs/typeql-reference/patterns/negations/index.md): Negations can be used to exclude certain subpatterns from your query results - an answer is excluded if it matches the subpattern. - [Optionals](https://typedb.com/docs/typeql-reference/patterns/optionals/index.md): Optional patterns can be used in match stages to optionally match a pattern, or in insert stages to insert a pattern if all the variables involved are bound. - [Delete stage](https://typedb.com/docs/typeql-reference/pipelines/delete/index.md): A delete stage deletes data from the database. Deletable data includes instances of types, ownerships of attributes, and role players of relations. - [Distinct operator](https://typedb.com/docs/typeql-reference/pipelines/distinct/index.md): The distinct operator removes duplicate elements from the data stream. Elements are considered duplicates if all their variables have the same values. - [End clause](https://typedb.com/docs/typeql-reference/pipelines/end/index.md): The end clause explicitly marks the end of a query. It is primarily used to separate multiple data pipeline queries when they are written in sequence - in essence letting the … - [Fetch stage](https://typedb.com/docs/typeql-reference/pipelines/fetch/index.md): Fetch is primarily used to convert row answers into document (JSON) answers. The fetch clause is terminal, meaning that it cannot be followed by any other pipeline stage. - [Given rows declaration](https://typedb.com/docs/typeql-reference/pipelines/given/index.md): A given stage preceding a query indicates the pipeline expects input "rows" to be provided along when the query is executed. It declares a number of input variables, and the … - [Data pipelines](https://typedb.com/docs/typeql-reference/pipelines/index.md): This reference covers the usage of data pipelines in TypeQL. Data pipeline read and modify data in stages. - [Insert stage](https://typedb.com/docs/typeql-reference/pipelines/insert/index.md): An insert stage inserts new data into the database. Insertable data includes instances of types, ownerships of attributes, and role players of relations. - [Limit operator](https://typedb.com/docs/typeql-reference/pipelines/limit/index.md): The limit operator stops producing rows after the specified row limit has been reached. - [Match stage](https://typedb.com/docs/typeql-reference/pipelines/match/index.md): A match stage performs pattern-based data retrieval and filtering. It takes input data assigned variables and verifies that this data satisfies the patterns in the body of the … - [Offset operator](https://typedb.com/docs/typeql-reference/pipelines/offset/index.md): The offset operator skips rows until the specified number has been skipped, then produces the remaining rows as normal. - [Put stage](https://typedb.com/docs/typeql-reference/pipelines/put/index.md): A put stage will insert data according to a pattern if no existing data matches that pattern. - [Reduce operator](https://typedb.com/docs/typeql-reference/pipelines/reduce/index.md): TypeQL supports the following reduce operators: - [Require operator](https://typedb.com/docs/typeql-reference/pipelines/require/index.md): The require operator filters the data stream to only include elements that contain the specified variables. Elements where any of the specified variables are unbound (empty) are … - [Select operator](https://typedb.com/docs/typeql-reference/pipelines/select/index.md): The select operator restricts the stream of rows to only contain the variables specified. - [Sort operator](https://typedb.com/docs/typeql-reference/pipelines/sort/index.md): The sort operator sorts the input stream based on the variables and their sort order. - [Update stage](https://typedb.com/docs/typeql-reference/pipelines/update/index.md): An update stage updates data in the database. Updatable data includes ownerships of attributes and role players of relations. - [Preamble](https://typedb.com/docs/typeql-reference/pipelines/with/index.md): The preamble of a pipeline allows the local declaration of functions using with statements. These functions can be called from the pipeline, and from other preamble functions. - [Define query](https://typedb.com/docs/typeql-reference/schema/define/index.md): Define queries are used to add new types, capabilities, annotations, or functions to the schema. - [Schema queries](https://typedb.com/docs/typeql-reference/schema/index.md): This reference covers the usage of schema queries in TypeQL. These queries can be only executed in schema transactions. - [Redefine query](https://typedb.com/docs/typeql-reference/schema/redefine/index.md): Redefine queries are used to modify existing types, capabilities, annotations, or functions in the schema, or to rename types. - [Undefine query](https://typedb.com/docs/typeql-reference/schema/undefine/index.md): Undefine queries are used to remove existing types, capabilities, annotations, or functions from the schema. - [alias statement](https://typedb.com/docs/typeql-reference/statements/alias/index.md): Coming soon. - [attribute statement](https://typedb.com/docs/typeql-reference/statements/attribute/index.md): The statement attribute