Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cassandra Design Patterns

You're reading from   Cassandra Design Patterns Build real-world, industry-strength data storage solutions with time-tested design methodologies using Cassandra

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781785285707
Length 168 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rajanarayanan Thottuvaikkatumana Rajanarayanan Thottuvaikkatumana
Author Profile Icon Rajanarayanan Thottuvaikkatumana
Rajanarayanan Thottuvaikkatumana
Arrow right icon
View More author details
Toc

Map pattern

Whenever there is a need to provide a mapping of keys to values as part of a record, use the Cassandra data type Map in the column family. The "as part of a record" part of preceding sentence is very important. This must not be misunderstood as any general lookup service of records such as the master tables in the RDBMS world.

Motivations/solutions

In the normalized RDBMS tables, whenever there is a need to provide a key to value mapping for an entity, the easiest and most straightforward approach is to create a small lookup table with the key as the primary key of the lookup table and the value as the non-primary key. Just like all the other patterns discussed in this chapter, the joins of the tables are required to get all the pieces of data together even here. All the perils of the table joins are applicable here too. Cassandra comes with a data type Map that can be used in the column families to solve this problem. This avoids the need to have joins and indexes to...

You have been reading a chapter from
Cassandra Design Patterns - Second Edition
Published in: Nov 2015
Publisher:
ISBN-13: 9781785285707
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime