Set pattern

Whenever there is a set in a real-world use case, use the Cassandra data type Set in the column family. Whenever the set in the real-world use case does not mandate the order of items, and if the items don't repeat, the Set data type in Cassandra is ideal. In the applications, even if the duplicate check is relaxed, since the Set data type cannot handle duplicate items, it will not take duplicate items.

Motivations/solutions

In the normalized RDBMS tables, whenever there is a need to have a set of things associated with an entity, the easiest and the most straightforward approach is to have a one-to-many relationship of two tables. When the reports or other business processes need all these pieces of data together, a multi-table join ...

Get Cassandra Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.