Creating a tuple column

Let's say we'd like to allow users to add some information about their education to their profile. In particular, users should be able to enter where they went to university and what year they graduated.

There are two distinct pieces of information here: school name and graduation year. However, the two are really two components of a single piece of information. It would make no sense, for instance, to store a graduation year but not a school name. For this reason, education is a good candidate for using a tuple type. The syntax for creating a tuple column is similar to that for creating a collection column: we specify both the fact that we would like to use a tuple type and the individual types of each component of ...

Get Learning Apache Cassandra - 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.