O'Reilly logo

Apache Karaf Cookbook by Heath Kesler, Johan Edstrom, Jamie Goodyear, Achim Nierbeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required