Home / Companies / SurrealDB / Blog / Post Details
Content Deep Dive

The life-changing magic of SurrealDB record IDs

Blog post from SurrealDB

Post Details
Company
Date Published
Author
Alexander Fridriksson
Word Count
971
Language
English
Hacker News Points
-
Summary

SurrealDB introduces a unique approach to handling record IDs, which consist of a table name and a record identifier, offering advantages over traditional auto-increment or serial IDs by using cryptographically secure randomly generated identifiers. This method enhances database concurrency, scalability, and security, preventing issues like accidental information disclosure and non-uniqueness across distributed nodes. SurrealQL, the query language used by SurrealDB, enables efficient and flexible data retrieval without requiring a table scan, resulting in near-constant performance as the database scales. The innovative use of complex record IDs in SurrealDB allows for dynamic expressions and parameterization, which can be advantageous for time series data and maintaining data locality, effectively creating clustered indexes and partitions. This flexibility in modeling data, combined with the performance benefits, opens up new possibilities for database management, encouraging developers to explore the potential of SurrealDB's record IDs.