Release of the Relational-Graph Database EdgeDB 5.0

The release of EdgeDB 5.0 is now available, implementing a relational-graph model and the EdgeQL query language optimized for handling complex hierarchical data. The project is developed as an extension of PostgreSQL, with code written in Python and Rust (for the parser and performance-critical parts), and is distributed under the Apache 2.0 license. Client libraries are prepared for Python, Go, Rust, .NET, Elixir, and TypeScript/Javascript. A command-line toolkit is provided for managing the database and executing queries interactively (REPL).

Instead of a table-based data model, EdgeDB employs a declarative system based on object types. Instead of foreign keys to define relationships between types, it uses links (one object can be used as a property of another object).

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

Features supported include strict property typing, value constraints, computed properties, and stored procedures. Notable aspects of the EdgeDB storage object schema, which resembles an ORM, include the ability to mix schemas, link properties from different objects, and integrated support for JSON. Indexes can be employed to accelerate query processing.

Built-in tools are provided for schema migration — after changing the schema defined in a separate esdl file, simply execute the command 'edgedb migration create' and the database 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.

To form queries, both the GraphQL query language and the proprietary EdgeDB language are supported, which adapts SQL for hierarchical data. Instead of lists, query results are presented in a structured format, and instead of subqueries and JOIN operations, one EdgeQL query can be specified as an expression within another query. Transactions and loops 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 the new version:

  • Support for branching has been added, allowing the use of the concept of branches when working with data and schemas, similar to version control systems. Instead of the term 'database', the new release introduces the term 'branch', and the commands 'create database' and 'drop database' have been deprecated in favor of the new commands 'create empty branch' and 'drop branch'. In addition to empty branches, existing branches and databases can be diverged using the commands 'create schema branch' and 'create data branch', copying their storage schema and data.

    From a practical perspective, branch support allows you to synchronize data with the code used for processing it, while maintaining compatibility with older code. For example, after updating the code, you can link it to a new data branch that reflects changes made to the storage schema. This functionality is convenient for simplifying the development and testing of new software versions, after which switching to the already tested branch is sufficient.

  • The pgvector extension, used for efficient storage and querying of vectors, has introduced a new type of HNSW (Hierarchical Navigable Small Worlds) index, which, like the IVFFlat index, is available in three variants: ext::pgvector::hnsw_euclidean, ext::pgvector::hnsw_ip, and ext::pgvector::hnsw_cosine. Additionally, pgvector has enhanced index tuning capabilities through the ext::pgvector::Config object.
  • Additional authentication options have been added. The auth extension now supports passwordless authentication schemes, including WebAuthn (Passkeys) and 'magic links' (based on email). Support for using Slack and Discord platforms as OAuth providers has also been added.
  • Performance optimizations have been implemented. In the caching of query compilation results, state preservation between restarts has been ensured, and automatic recompilation after migration has been added. The speed of operations with large storage schemas has been enhanced.
  • In the EdgeQL query language, the 'for' expression no longer requires the 'union' keyword in basic queries that involve the insert, update, or delete expressions.
  • A vacuum() command has been added for cleansing, optimizing, and packing the contents of the database.
  • Data conversion between the bytes type and int16, int32, int64, and uuid types is now allowed, using the functions to_bytes(), to_uuid(), and to_int*().
  • The capability to close all connections to the database after executing the 'drop database' operation has been added.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster