Skip to content

Commit

Permalink
Record links now have some advantages that only graphs had previously
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon committed Dec 30, 2024
1 parent 3f09115 commit d24e178
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/content/doc-surrealql/statements/relate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Otherwise, edge tables behave like normal tables in terms of [updating](/docs/su

Another option for connecting data is using [record links](/docs/surrealql/datamodel/records). Record links consist of a field with record IDs that serve as uni-directional links. The key differences are that graph relations have the following benefits over record links:

- They are kept in a separate table as opposed to a field inside a record.
- Offer bi-directional querying.
- Offer referential integrity.
- Allow you to store data alongside the relationship.
- Graph relations are kept in a separate table as opposed to a field inside a record.
- Graph relations you to store data alongside the relationship.
- Graph relations have their own syntax that makes it easy to build and visualize edge queries.

Graph relations also offer built-in bi-directional querying and referential integrity. As of SurrealDB 2.2.0, record links also offer these two advantages if they are defined inside a [`DEFINE FIELD`](/docs/surrealql/statements/define/field) statement using the `REFERENCES` clause. For more information, see [the page on record references](/docs/surrealql/datamodel/references).

### Statement syntax

Expand Down

0 comments on commit d24e178

Please sign in to comment.