Skip to Content
Cassandra: The Definitive Guide
book

Cassandra: The Definitive Guide

by Eben Hewitt
November 2010
Intermediate to advanced
328 pages
9h 38m
English
O'Reilly Media, Inc.
Content preview from Cassandra: The Definitive Guide

Chapter 4. Sample Application

In this chapter, we create a complete sample application so we can see how all the parts fit together. We will use various parts of the API to see how to insert data, perform batch updates, and search column families and super column families.

To create the example, we want to use something that is complex enough to show the various data structures and basic API operations, but not something that will bog you down with details. In order to get enough data in the database to make our searches work right (by finding stuff we’re looking for and leaving out stuff we’re not looking for), there’s a little redundancy in the prepopulation of the database. Also, I wanted to use a domain that’s familiar to everyone so we can concentrate on how to work with Cassandra, not on what the application domain is all about.

Note

The code in this chapter has been tested against the 0.7 beta 1 release, and works as shown. It is possible that API changes may necessitate minor tuning on your part, depending on your version.

Data Design

When you set out to build a new data-driven application that will use a relational database, you might start by modeling the domain as a set of properly normalized tables and use foreign keys to reference related data in other tables. Now that we have an understanding of how Cassandra stores data, let’s create a little domain model that is easy to understand in the relational world, and then see how we might map it from a relational to a distributed ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cassandra: The Definitive Guide, 3rd Edition

Cassandra: The Definitive Guide, 3rd Edition

Jeff Carpenter, Eben Hewitt
Data modeling with Cassandra

Data modeling with Cassandra

Jeff Carpenter, Eben Hewitt

Publisher Resources

ISBN: 9781449399764Supplemental ContentErrata Page