2

TL;DR: I have a very superficial understanding of Cassandra and am currently evaluating it for a project.

  • Can Cassandra be embedded into another JVM application?
  • Can such embedded instances form a cluster?
  • Can the application use the the failure detection and cluster membership dissemination infrastructure of embedded Cassandra?

I am in the process of re-packaging a SaaS system written in Java to be deployed on-premise by customers. The SaaS system currently uses AWS DynamoDB. The data storage needs for this application are modest, but I would like to keep the deployment complexity to a minimum. Here are three different usecases the on-premise system should support:

  1. single-node deployments with minimal complexity
  2. two-node HA deployments; the data and processing needs dictated by the load on the system are well under what a single node can do, but the second node is there to satisfy the HA requirement as a hot standby
  3. a multi-node clustered deployment, where higher operational complexity is justified

I am considering Cassandra for these usecases.

For usecase #1, I hope to embed Cassandra into the same JVM as my application. I read on the web that CassandraDaemon can be used this way. Is that accurate? What other applications embed Cassandra this way? I think JetBrains Upsource does, but do you know other ones? (Incidentally, my Java application embeds Jetty webserver also).

For usecase #2, I am hoping that I can deploy two instances of this ensemble and have the embedded Cassandra instances form a cluster. If I configure every write to be replicated on both nodes synchronously, then it will satisfy the HA needs of this usecase. Is it feasible to form clusters of embedded Cassandra instances?

For usecase #3, I can form a large cluster of the ensemble where all writes are replicated synchronously to a quorum of nodes.

Finally, in usecase #2 and #3, I'd like to use the failure detection and cluster membership dissemination infrastructure of Cassandra from within my application. Is it possible to be notified of membership changes when embedding Cassandra? I could use a separate library to do this (say, with JGroups or Akka) but I fear that if this library and the embedded Cassandra instances disagrees, it could lead to subtle bugs.

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Binil Thomas
  • 13,699
  • 10
  • 57
  • 70
  • 1
    Your first two points are doable. E.g., the Titan graph database library can be configured to run with an [embedded Cassandra](http://s3.thinkaurelius.com/docs/titan/1.0.0/cassandra.html#_titan_embedded_mode), clustered. You might want to have a look at the source of their `embeddedcassandra` storage backend implementation. About your 3rd point I don't know. – Ralf Feb 14 '16 at 09:58

0 Answers0