Release of the relational graph database EdgeDB 2.0

The release of the EdgeDB 2.0 DBMS is presented, which implements the relational graph data model and the EdgeQL query language, optimized for working with complex hierarchical data. The code is written in Python and Rust (parser and performance-critical parts) and distributed under the Apache 2.0 license. The project is being developed as an add-on for PostgreSQL. Client libraries are prepared for Python, Go, Rust and TypeScript/Javascript languages. A command-line toolkit is provided 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 (foreign key) to determine the relationship between types, linking is used (one object can be used as a property of another object).

type Person { required property name -> str; } type Movie { required property title -> str; multi link actors -> Person; }

Indexes can be used to speed up query processing. Features such as strong property typing, property value constraints, computed properties, and stored procedures are also supported. Of the features of the EdgeDB object storage scheme, which is somewhat reminiscent of ORM, the ability to mix schemes, bind properties from different objects, and integrated JSON support is noted.

Built-in tools are provided for migrating the storage schema - after changing the schema specified in a separate esdl file, it is enough to execute the β€œedgedb migration create” command and the DBMS will analyze the differences in the schema and interactively generate a script to migrate to the new schema. Schema modification history is automatically tracked.

For querying, both the GraphQL query language and EdgeDB's own language, which is an adaptation of SQL for hierarchical data, is supported. Instead of lists, query results are formatted in a structured way, and instead of subqueries and JOIN operations, it is possible to 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' } ) } for number in {0, 1, 2, 3} union ( select { number, number + 0.5 } );

In the new version:

  • A built-in web interface for database administration has been added, which allows you to view and edit data, execute EdgeQL queries and analyze the storage scheme used. The interface is launched by the β€œedgedb ui” command, after which it becomes available when accessing localhost.
    Release of the relational graph database EdgeDB 2.0
  • The "GROUP" expression has been implemented, which allows you to partition and aggregate data and group data by arbitrary EdgeQL expressions, similar to grouping in a SELECT operation.
  • Ability to control access at the object level. Access rules are defined at the storage schema level and allow you to restrict the use of a specific set of objects in select, insert, delete, and update operations. For example, you can add a rule that allows only the author to update a post.
  • Added the ability to use global variables in the storage scheme. For binding to the user, a new global variable current_user has been proposed.
  • Added support for types that define ranges of values ​​(range).
  • The official client library for the Rust language has been prepared.
  • The EdgeDB binary protocol has been stabilized, in which it has become possible to process several different sessions simultaneously within the same network connection, forwarding via HTTP, using global variables and local states.
  • Added support for socket activation, which allows not to keep the server handler in memory and start it only when trying to establish a connection (useful for saving resources on development systems).

Source: opennet.ru

Add a comment