One of the most powerful features of SurrealDB is the ability to traverse from record-to-record without the need for traditional SQL JOINs. Each record ID points directly to a specific record in the database, without needing to run a table scan query. Record IDs can be stored within other records, allowing them to be linked together.
Creating a record
When you create a record without specifying the id, then a randomly generated id is created and used for the record id.
It's also possible to specify a specific record id when creating or updating records.
Select directly off of record IDs
Because Record IDs are their own datatype in SurrealQL, you are able to select directly off of them.
Storing record links within records
Records ids can be stored directly within other records, either as top-level properties, or nested within objects or arrays.
Fetching remote records from within records
Nested field traversal can be used to fetch the properties from the remote records, as if the record was embedded within the record being queried.
There is no limit to the number of remote traversals that can be performed in a query. Using . dot notation, SurrealDB does not differentiate between nested object properties, or remote records, and will fetch remote records asynchronously when needed for a query.