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

Thinking Inside The Box: Relational Style Joins in SurrealDB

Blog post from SurrealDB

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

SurrealDB reimagines traditional SQL joins by implementing semi-joins, anti-joins, and correlated subqueries, aiming to simplify database relationships and improve scalability and developer experience. Instead of relying on standard SQL joins that can result in unnecessary data duplication and additional computational overhead, SurrealDB encourages relationships to be established at write time, thereby ensuring more efficient queries at runtime. The article demonstrates how SurrealQL, a SQL-like language, uses subqueries to achieve similar outcomes to traditional SQL joins but with potentially better performance and less complexity, emphasizing the importance of evaluating both approaches based on specific use cases. SurrealDB's innovative approach, such as using record links, avoids table scans entirely and reduces the chance of errors by minimizing the amount of code needed. This philosophy aligns with the idea of "joy of missing out" (JOMO) on unnecessary complexities, positioning SurrealDB as a forward-thinking alternative for database management.