Modeling data with Apache Cassandra

Before we start writing a bundle using Apache Cassandra, let's look a little at how we model data in Cassandra using CQL 3.x.

Getting ready

Let's define a very simple schema, and as we are using CQL, Cassandra isn't schema-less from a client perspective even if the data storage internally works slightly differently.

We can reuse the RecipeService class from the previous chapter. We will just modify it slightly for our Cassandra integration. The original entity (and by virtue of using JPA) provides a basic table definition, which is as follows:

@Id
@Column(nullable = false)
private String title;

@Column(length=10000)
private String ingredients;

So, we have two fields in this table: an ID field named title and a data ...

Get Apache Karaf Cookbook 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.