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 :
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 :
Scala, Couchbase, Spark and Akka-http: A combinatory tutorial for starters
In future , we will be continuing the same thing using Neo4j too :P.
So stay tuned !
You can find the code here on my github: shiv4nsh
If You have any questions you can contact me here or on Twitter: @shiv4nsh
I would be happy to help.
happy hAKKAing ! ! !
2 thoughts on “Cassandra with Spark 2.0 : Building Rest API !4 min read”
Reblogged this on Anurag-Knoldus.
Comments are closed.