This project is to demonstrate how we can use Cassandra with Spring Boot. So here I have used two models student and subject, so here you can perform the CRUD operation on these models as well as you can get a list of students using subjectId, similarly you can get a list of subjects using studentId. I have also configured Swagger so you can easily access the APIs.
- JDK 8
- Cassandra 3.11.6
- Git
- JDK 8
- Gradle 6.3
- Spring Boot Web
- spring-boot-starter-data-cassandra
- Cassandra 3.11.6
- Lombok
- Mapstruct
- Swagger
- IDE
-
Set up Cassandra Cluster and create student_demo keyspace, you can choose either SimpleStrategy or NetworkTopologyStrategy for replication.
-
Go to the
/cassandra-springboot-demo/src/main/resources/application.properties
and update Cassandra properties as per your cluster set up. -
Go to the
/cassandra-springboot-demo/
directory and open terminal -
Execute the following command in the terminal
gradlew bootrun
or go to the
/cassandra-springboot-demo/src/main/java/com/demo/
directory and run the SpringBootCassandraDemoApplication class.
And now we can access the Swagger on this link: Swagger
Thank You