Chapter 13. Realtime views: Illustration
This chapter covers
- Cassandra’s data model
- Using Cassandra as a realtime view
- Controlling partitioning and ordering to support a wide range of view types
Now that you’ve learned the basics of the speed layer and realtime views, let’s take a look at Cassandra, a database that can be used as a realtime view. Cassandra is not a general-purpose realtime view by any means—many systems require multiple databases to satisfy all of their indexing, consistency, and performance requirements. For our purposes, however, Cassandra serves to illustrate the concepts of realtime views, and it’s the database that we’ll use for the speed layer of SuperWebAnalytics.com later in the book. There are many publicly available resources to help you understand the inner workings of the database, so we’ll focus on the properties of Cassandra from a user perspective.
While many tout Cassandra as a column-oriented database, we find that terminology to be somewhat confusing. Instead, it’s easier to consider the data model as a map with sorted maps as values (or optionally, a sorted map with sorted maps as values). Cassandra allows standard operations on the nested maps, such as adding key/value pairs, looking up by key, and getting ranges of keys.
To introduce the terminology, figure 13.1 illustrates the different aspects of the Cassandra data model. To expand upon the terms: