liveBook · Manning

Join

As explained in ScyllaDB in Action

A join is a database operation that combines related rows from two or more relations according to a matching condition.

A join combines related rows from multiple tables by matching column values. Relational databases use joins to follow links such as a restaurant ID and assemble one result. ScyllaDB does not support joins: the JOIN keyword is absent from CQL, and each query is designed to access one table for fast, predictable performance. section 3.1.1

Restaurant reviews without a join

A relational restaurant-review schema might store a review's restaurant ID in one table and the restaurant's name in another, then join the tables to display both. In ScyllaDB, store the restaurant name with the review or issue separate queries. The first option duplicates data but avoids cross-partition work. section 3.1.1 section 3.2.1

Design consequences of not having joins include:

  • Do not rely on foreign keys or referential integrity to validate IDs that refer to records in another table. section 3.1.1
  • Model tables around the queries they must serve, often using denormalization and storing the same data in multiple places. section 3.2.1
  • Choose duplication or multiple database queries when an application needs related information from separate datasets. section 3.2.1
JOIN queries are unsupported in ScyllaDB, meaning you need to design your schema so as not to need this pattern.
sidebar figure

Use the figure to see why unsupported joins require schema designs that avoid the pattern. section 3.1.1

How ScyllaDB in Action covers it

How deep it goes
Defines joins, demonstrates their relational use, and stops at their performance implications and schema alternatives in ScyllaDB.
Examples
Uses restaurant reviews, article authors, and store items with prices to contrast joins, duplication, and multiple queries.
What it assumes
Assumes basic tables, rows, columns, and relational links while explaining joins and ScyllaDB's different modeling constraints.
What you can do after
Evaluate when a relational join must become denormalized data or multiple queries in a ScyllaDB schema.
How it connects
Connects joins to relational databases, foreign keys, referential integrity, denormalization, partition keys, and CQL.

Also explained in

Compare how 16 books explain join →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.