---
title: Using Docker to simplify Cassandra development in JHipster
description: "[https://raw.githubusercontent.com/ippontech/blog-usa/master/images/2016/06/logo-jhipster2x-1.png]\nJHipster is an open source project that generates a fully working application in\nseconds. With a minimal configuration, JHipster accelerates the start of new\nprojects by integrating frontend, backend, security and a database.\n\nCassandra is one of the"
image: https://blog.ippon.tech/hubfs/Imported_Blog_Media/using-docker-1-2-3.jpg
---

[Skip to main content](https://blog.ippon.tech/using-docker-to-simplify-cassandra-development-in-jhipster#main)

[![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=219&height=64&name=IpponLogoKleinBlue.png) ![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=219&height=64&name=IpponLogoKleinBlue.png) ![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=168&height=49&name=IpponLogoKleinBlue.png) ![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=168&height=49&name=IpponLogoKleinBlue.png)](https://ipponusa.com/)

- [Home](https://ipponusa.com)
- [Show submenu for About About](https://ipponusa.com/about-us) 
    - [Who We Are](https://ipponusa.com/who-we-are)
    - [Careers](https://ipponusa.com/careers)
    - [Show submenu for Our Partners Our Partners](https://ipponusa.com/our-partners/) 
          - [AWS](https://ipponusa.com/our-partners/aws/)
          - [Snowflake](https://ipponusa.com/our-partners/snowflake/)
          - [Databricks](https://ipponusa.com/our-partners/databricks/)
          - [Microsoft](https://ipponusa.com/our-partners/microsoft/)
- [Show submenu for Services Services](https://ipponusa.com/services) 
    - [Snowflake](https://ipponusa.com/service/snowflake-concierge/)
    - [Artificial Intelligence](https://ipponusa.com/service/artificial-intelligence/)
    - [Data & Analytics](https://ipponusa.com/service/data-analytics/)
    - [Cloud Strategy](https://ipponusa.com/service/cloud-strategy/)
    - [Platform Modernization](https://ipponusa.com/service/platform-moderization/)
    - [Product Innovation](https://ipponusa.com/service/product-innovation/)
    - [Operating Model](https://ipponusa.com/service/operating-model/)
- [Blogs](https://blog.ippon.tech/)
- [Success Stories](https://ipponusa.com/success-stories/)
- [Show submenu for Resources Resources](https://ipponusa.com/resources/) 
    - [eBooks](https://ipponusa.com/ebooks/)
    - [The Data Pour](https://info.ippon.tech/the-data-pour)
    - [Videos & Webinars](https://info.ippon.tech/videos-and-webinars)
    - [Media Center](https://ipponusa.com/media-center/)

Search

Open main navigation

Close main navigation

- [Home](https://ipponusa.com)
- Show submenu for About About 
  
    - About
    - [About](https://ipponusa.com/about-us)
    - [Who We Are](https://ipponusa.com/who-we-are)
    - [Careers](https://ipponusa.com/careers)
    - Show submenu for Our Partners Our Partners 
      
          - Our Partners
          - [Our Partners](https://ipponusa.com/our-partners/)
          - [AWS](https://ipponusa.com/our-partners/aws/)
          - [Snowflake](https://ipponusa.com/our-partners/snowflake/)
          - [Databricks](https://ipponusa.com/our-partners/databricks/)
          - [Microsoft](https://ipponusa.com/our-partners/microsoft/)
- Show submenu for Services Services 
  
    - Services
    - [Services](https://ipponusa.com/services)
    - [Snowflake](https://ipponusa.com/service/snowflake-concierge/)
    - [Artificial Intelligence](https://ipponusa.com/service/artificial-intelligence/)
    - [Data & Analytics](https://ipponusa.com/service/data-analytics/)
    - [Cloud Strategy](https://ipponusa.com/service/cloud-strategy/)
    - [Platform Modernization](https://ipponusa.com/service/platform-moderization/)
    - [Product Innovation](https://ipponusa.com/service/product-innovation/)
    - [Operating Model](https://ipponusa.com/service/operating-model/)
- [Blogs](https://blog.ippon.tech/)
- [Success Stories](https://ipponusa.com/success-stories/)
- Show submenu for Resources Resources 
  
    - Resources
    - [Resources](https://ipponusa.com/resources/)
    - [eBooks](https://ipponusa.com/ebooks/)
    - [The Data Pour](https://info.ippon.tech/the-data-pour)
    - [Videos & Webinars](https://info.ippon.tech/videos-and-webinars)
    - [Media Center](https://ipponusa.com/media-center/)
- Search
- [Contact Us](https://ipponusa.com/contact/)

[Contact Us](https://ipponusa.com/contact/)

# Using Docker to simplify Cassandra development in JHipster

![Raphael Brugier](https://app.hubspot.com/settings/avatar/d41d8cd98f00b204e9800998ecf8427e)

 by [Raphael Brugier](https://blog.ippon.tech/author/raphael-brugier)

June 27, 2016

![Using Docker to simplify Cassandra development in JHipster](https://blog.ippon.tech/hubfs/Imported_Blog_Media/using-docker-1-2-3.jpg)

[Docker](https://blog.ippon.tech/tag/docker/)

 

 Jun 27, 2016

<iframe id="{&quot;xdOrigin&quot;:&quot;https://blog.ippon.tech&quot;,&quot;xdChannel&quot;:&quot;74db206c-b1bd-4876-9ed5-cd382533580b&quot;,&quot;framework&quot;:&quot;@linkedin/xdoor-sdk&quot;,&quot;version&quot;:&quot;0.1.176&quot;,&quot;debug&quot;:false}" class="IN-widget IN-widget--iframe" style="vertical-align: bottom; margin: 0px auto; display: block;" title="LinkedIn Embedded Content" xml="lang" src="https://www.linkedin.com/cws/member/public_profile?public_profile_url=http%3A%2F%2Flinkedin.com%2Fin%2Fraphaelbrugier&amp;format=inline&amp;related=false&amp;width=286&amp;xdOrigin=https%3A%2F%2Fblog.ippon.tech&amp;xdChannel=74db206c-b1bd-4876-9ed5-cd382533580b&amp;xd_origin_host=https%3A%2F%2Fblog.ippon.tech" name="{&quot;xdOrigin&quot;:&quot;https://blog.ippon.tech&quot;,&quot;xdChannel&quot;:&quot;74db206c-b1bd-4876-9ed5-cd382533580b&quot;,&quot;framework&quot;:&quot;@linkedin/xdoor-sdk&quot;,&quot;version&quot;:&quot;0.1.176&quot;,&quot;debug&quot;:false}" width="1" height="1" frameborder="0" scrolling="no"></iframe>

[![JHipster](https://blog.ippon.tech/hubfs/Imported_Blog_Media/logo-jhipster2x-1-2.png)](https://static.hsstatic.net/BlogImporterAssetsUI/ex/missing-image.png)JHipster is an open source project that generates a fully working application in seconds. With a minimal configuration, JHipster accelerates the start of new projects by integrating frontend, backend, security and a database.

Cassandra is one of the supported databases and JHipster generates all the configuration needed to access the cluster.

But it is often hard for the developers to configure and maintain a local Cassandra cluster.

Moreover, there is no standard tooling to manage the schema migrations, like Liquibase or Flyway for SQL databases, making it difficult to synchronize the schema between every environment and a local configuration.

JHipster’s goal is to provide the most simple and productive development environment out of the box for the developers, and this tool has been added in [the latest (3.4.0)](https://jhipster.github.io/2016/05/27/jhipster-release-3.4.0.html?ref=blog.ippon.tech) version.

In this post, I’ll describe the design of the tool and the basic commands to use it.

## Design

A Docker Compose(1) configuration is generated to start a Cassandra cluster locally with one command. A set of bash scripts automatically save the executed migrations in a dedicated table. This allows you to automatically(2) execute only the new migration scripts when deploying a new version of the application.  
The tool can be used both by the developers to synchronize their local cluster and in production to keep track of the schema migrations.

The standardization of the migration scripts is also used by the integration tests to start an in-memory Cassandra cluster.

(1) JHipster uses the v2 of the Docker Compose file format and Docker 1.10+ and Compose 1.6+ are required.

(2) Because the migration scripts are read from a Docker volume, the sources must be located in the use directory.

## Basic commands to run the migration tool

##### Launch a JHipster application and a Cassandra cluster:

First you need to build a Docker image containing your application:

```
./mvnw package -Pprod docker:build
```

Then you can run this image and the other services with Docker Compose:

```
docker-compose -f src/main/docker/app.yml up -d
```

Compose starts 4 Docker containers:

- The application image
- A first Cassandra node acting as the contact point
- A second node joining the cluster
- A service executing the schema migrations

Thanks to Docker Compose, it is easy to add new nodes in the cluster:

```
docker-compose -f src/main/docker/app.yml scale yourapp-cassandra-node=2
```

The new node automatically joins the Cassandra cluster using the first node as a contact point.The container executing the migrations reads a dedicated folder – \*config/cql/changelogs/ \*by convention – to find the migration scripts.

Like Liquibase, the migration tool stores the metadata of the executed scripts in a table named schema\_version to keep track of executed scripts.

##### Modifying the schema with JHipster and using the migration tool:

With JHipster, it is possible to create a new domain entity in one command with a few questions:

```
$ yo jhipster:entity book
Generating field #1? Do you want to add a field to your entity? Yes
? What is the name of your field? title

? What is the type of your field? String

? Do you want to add validation rules to your field? No
Generating field #2

? Do you want to add a field to your entity? Yes

? What is the name of your field? author

? What is the type of your field? String

? Do you want to add validation rules to your field? No
Generating field #3

? Do you want to add a field to your entity? Yes

? What is the name of your field? releaseDate

? What is the type of your field? LocalDate (Warning: only compatible with cassandra v3)

? Do you want to add validation rules to your field? No
? Do you want to use a Data Transfer Object (DTO)? No, use the entity directly

? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly
```

JHipster generates AngularJS code for the frontend and java code for the basic CRUD operations. It also generates the CQL script to create the Cassandra table for this new entity:

```
CREATE TABLE IF NOT EXISTS book (
   id uuid,
   title text,
   author text,
   releaseDate date,
   PRIMARY KEY(id)
);
```

Without stopping the cluster, you can execute the migration tool to run the CQL script:

```
docker-compose -f src/main/docker/app.yml up yourapp-cassandra-migration
```

Package the application into a new image and relaunch only its container:

```
./mvnw package -Pprod docker:build
docker-compose -f src/main/docker/app.yml up -d --no-deps yourapp-app
```

Without restarting the Cassandra cluster, JHipster has created all the screens, the java code and has executed the migration script to create the new Cassandra table:

[![JHipster generated](https://blog.ippon.tech/hubfs/Imported_Blog_Media/Screen-Shot-2016-05-24-at-4_10_47-PM-1024x486-2.png)](https://static.hsstatic.net/BlogImporterAssetsUI/ex/missing-image.png)

By providing a simple tool to manage a Cassandra environment for development, tests and deployment JHipster is also providing best practices to start new applications based on Cassandra.

You can find more on the [JHipster project website](http://jhipster.github.io/?ref=blog.ippon.tech).  
Ippon USA is hosting a master class on JHipster with material designed by the JHipster creator, [register here](https://www.eventbrite.com/e/jhipster-master-class-ippon-usa-tickets-21358779685?ref=blog.ippon.tech) !

## Related Articles

##### [![Easily Deploy a Minecraft Server onto GCP using Terraform & Docker](https://blog.ippon.tech/hs-fs/hubfs/Imported_Blog_Media/minecraft221-3.jpg?width=520&height=294&name=minecraft221-3.jpg) Terraform • June 8, 2020 Easily Deploy a Minecraft Server onto GCP using Terraform & Docker 8 min read](https://blog.ippon.tech/easily-deploy-a-minecraft-server-onto-gcp-using-terraform-docker-2)

##### [![How Kubernetes Add to Your Business](https://blog.ippon.tech/hs-fs/hubfs/Imported_Blog_Media/kubernetes-image-3.png?width=520&height=294&name=kubernetes-image-3.png) Kubernetes • June 13, 2019 How Kubernetes Add to Your Business 2 min read](https://blog.ippon.tech/how-kubernetes-add-to-your-business)

##### [![Tips and reminders for using Docker daily](https://blog.ippon.tech/hs-fs/hubfs/Imported_Blog_Media/docker_logo-Jan-18-2024-06-08-25-3571-PM.png?width=520&height=294&name=docker_logo-Jan-18-2024-06-08-25-3571-PM.png) Docker • June 15, 2018 Tips and reminders for using Docker daily 6 min read](https://blog.ippon.tech/tips-and-reminders-for-using-docker-daily)

### Comments

### Subscribe to Our Blog!

Stay informed with the latest insights and updates by signing up for our weekly blog newsletter – delivered straight to your inbox!

[Back to blog homepage »](https://blog.ippon.tech/)

![IpponLogoKleinBlue](https://blog.ippon.tech/hs-fs/hubfs/IpponLogoKleinBlue.png?width=247&height=73&name=IpponLogoKleinBlue.png "IpponLogoKleinBlue")

Ippon is a consulting and expertise firm, who is convinced that technology is a source of progress for society. We help our clients leverage their digital assets to design an appropriate strategy and deploy their transformation roadmap at scale.

#### Navigation

- [Home](https://ipponusa.com/)
- [About](https://ipponusa.com/about-us/)
- [Services](https://ipponusa.com/services/)
- [Blogs](https://blog.ippon.tech/?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)
- [eBooks](https://ipponusa.com/ebooks/)
- [The Data Pour](https://info.ippon.tech/the-data-pour?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)

[Contact Us](https://ipponusa.com/contact/)

[Join Us](https://ipponusa.com/careers/)

#### Services

- [Data & Analytics](https://ipponusa.com/service/data-analytics/)
- [Cloud Strategy](https://ipponusa.com/service/cloud-strategy/)
- [Artificial Intelligence](https://ipponusa.com/service/artificial-intelligence/)
- [Operating Model](https://ipponusa.com/service/operating-model/)
- [Platform Modernization](https://ipponusa.com/service/platform-moderization/)
- [Product Innovation](https://ipponusa.com/service/product-innovation/)

#### Ippon International

- [France](https://fr.ippon.tech/?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)
- [Australia](https://au.ippon.tech/?__hstc=223043268.1036d82247623b329dfefe4e92697801.1714729179243.1714729179243.1714729179243.1&__hssc=223043268.2.1714729179244&__hsfp=803678701)

- #### Contact
- Ippon Technologies  
  [3431 West Leigh Street Richmond, VA 23230, USA](https://maps.app.goo.gl/RySm6SAwZnsxeiLz9)
- [(844) 477- 6687](tel:8444776687)
- [Sales@ipponusa.com](mailto:Sales@ipponusa.com)

<https://www.facebook.com/IpponUSA/> <https://www.youtube.com/c/ipponusa> <https://www.linkedin.com/company/ippon-technology>

©Copyright 2024 Ippon USA. All Rights Reserved.   |   [Terms and Conditions](https://ipponusa.com/privacy-policy/)   |   [Privacy Policy](https://ipponusa.com/privacy-policy/)   |   [Website by Skol Marketing](https://skolmarketing.com/)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Raphael Brugier",
    "url" : "https://blog.ippon.tech/author/raphael-brugier"
  },
  "dateModified" : "2024-01-29T16:21:16.512Z",
  "datePublished" : "2016-06-27T16:27:00.000Z",
  "headline" : "Using Docker to simplify Cassandra development in JHipster",
  "image" : [ "https://blog.ippon.tech/hubfs/Imported_Blog_Media/using-docker-1-2-3.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.ippon.tech/using-docker-to-simplify-cassandra-development-in-jhipster",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.ippon.tech/hubfs/logo_SVG.svg"
    },
    "name" : "Ippon Technologies"
  }
}
```