Introducing EdgeDB 5.0: A New Relational Graph Database Management System

Available DBMS release EdgeDB 5.0, which implements the relational graph data model and the EdgeQL query language, optimized for working with complex hierarchical data. The project is developed in the form of an add-on for PostgreSQL, the code of which is written in Python and Rust (parser and performance-critical parts), and distributed by licensed under Apache 2.0. Client libraries prepared for languages Python, Go, Rust. .NET, Elixir And TypeScript/Javascript. Provides command line tools for DBMS management and interactive query execution (REPL).

Instead of a table-based data model, EdgeDB uses a declarative system based on object types. Instead of foreign keys, linking by reference is used to define the relationship between types (one object can be used as a property of another object).

 type Person { required name: str; } type Movie { required title: str; multi actors: Person; }

Supported features include strong property typing, property value restrictions, computed properties, and stored procedures. Among the features of the EdgeDB object storage scheme, which is somewhat reminiscent of an ORM, noted the ability to mix schemas, link properties from different objects, and integrated JSON support. Indexes can be used to speed up query processing.

Built-in tools are provided for migration storage schema – after changing the schema specified in a separate esdl file, just run the “edgedb migration create” command and the DBMS will analyze the differences in the schema and interactively generate a script for migrating to the new schema. The history of schema changes is automatically tracked.

GraphQL and native query language are supported for generating queries EdgeDB, which is an adaptation of SQL for hierarchical data. Instead of lists, query results are formatted in a structured way, and instead of subqueries and JOINs, you can specify one EdgeQL query as an expression within another query. Transactions and cycles are supported.

 select Movie { title, actors: { name } } filter .title = "The Matrix" insert Movie { title := "The Matrix Resurrections", actors := ( select Person filter .name in { 'Keanu Reeves', 'Carrie-Anne Moss', 'Laurence Fishburne' } ) }

IN new version:

  • Added support for branching, allowing you to use the concept of branches used in version control systems when working with data and schemas. The new release replaces the term “database” with the term “branch”, and the “create database” and “drop database” commands are deprecated and the new “create empty branch” and “drop branch” commands are recommended instead. In addition to empty branches, using the “create schema branch” and “create data branch” commands, you can create branches from existing branches and databases, copying the storage schema and data from them.

    On the practical side, branching allows you to keep data in sync with the code used to process it, while maintaining compatibility with older code. For example, after updating the code, you can attach a new data branch to it, taking into account the change in the storage scheme made in the code. The considered functionality is convenient to use to simplify the development and testing of new software versions, after which it is enough to switch to an already tested branch.

  • The pgvector extension, used for efficient storage and querying of vectors, has added a new type of index HNSW (Hierarchical Navigable Small Worlds), which, similar to the IVFFlat index, is available in three versions: ext::pgvector::hnsw_euclidean, ext::pgvector: :hnsw_ip and ext::pgvector::hnsw_cosine. In addition, pgvector has expanded the ability to fine-tune indexes through the object ext::pgvector::Config.
  • Added additional authentication options. The auth extension provides support for passwordless authentication schemes WebAuthn (Passkeys) and “magic links” (email based). Added support for using Slack and Discord platforms as OAuth providers.
  • Made performance optimizations. In the implementation of the cache with the results of query compilation, state saving between restarts is ensured and automatic recompilation after migration is added. Increased speed of working with large storage schemes.
  • The EdgeQL query language allows the “for” clause to omit the “union” keyword in base queries that use insert, update, or delete expressions.
  • Added vacuum() command for cleaning, optimizing and packaging database contents.
  • Allows data conversion between the bytes type and the int16, int32, int64 and uuid types using the to_bytes(), to_uuid() and to_int*() functions.
  • Added the ability to close all connections to the database after performing the “drop database” operation.

Thanks for reading: