In this tutorial , we will be demonstrating how to make a REST service in Spark using Akka-http as a side-kick 😉 and Cassandra as the data store.

We have seen the power of Spark earlier and when it is combined with Cassandra in a right way it becomes even more powerful. Earlier we have seen how to build Rest Api on Spark and Couchbase in this blog post, hence this will be about how to do the same thing in Cassandra.

So lets get started with the Code:

Your build.sbt should look like this :

Database Access layer:

And your Database Access layer should look like this :

Service Layer:

Now your routing file should look like this :

This blog is in the continuation of building your rest services using Spark and Couchbase and here we just changed the datastore to Cassandra, and hence I did not explained each and every step. It contains just the simple implementation of REST API! If you want to know in detail please take a look here :