Book Image

Learning Apache Cassandra

By : Matthew Brown
4 (1)
Book Image

Learning Apache Cassandra

4 (1)
By: Matthew Brown

Overview of this book

Table of Contents (19 chapters)
Learning Apache Cassandra
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we looked at ways to model relationships between objects that go beyond the straightforward parent-child relationships that are captured elegantly by a compound primary key. We found that query-driven schema design motivated us to create multiple representations of the follow relationship; each representation optimized to answer a specific question about follows. This led us to a denormalized schema, wherein each follow has multiple representations in our database.

While our denormalized schema requires more write operations than a normalized one, and extra care at the application level to ensure the different representations of follows are consistent with one another, we end up with better overall performance because writing data to Cassandra is cheaper than reading it. By designing our schema to allow Cassandra to efficiently access data in a single partition to answer any question the application needs, we ensure that Cassandra can continue efficiently serving...