Embedded option

23 views
Skip to first unread message

gw

unread,
Mar 9, 2018, 8:39:10 AM3/9/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Newbie question: is there an analogous mode in DSE to running TitanDB in embedded mode within the client application, by connecting directly to Cassandra?  Also, is there an option to run in-memory w/o connecting to Cassandra, which is useful for running functional tests?

Any hints would be greatly appreciated!

Cheers,
gw

Andy Tolbert

unread,
Mar 9, 2018, 10:21:29 AM3/9/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi gw,

Great question!  While there unfortunately there isn't an in-memory option for Cassandra (a la H2), there are a few options I can think of for running with a C* or DSE instance along with your app.   All of these options are more oriented towards testing,  I would not recommend them for running an application beyond proof of concept:
  • cassandra-unit - A library that allows running an embedded (in-JVM) cassandra process.   This is the most contained option since it runs C* in the same JVM as your code.   C* only.
  • java-driver-test-infra - This is a new module we are developing with the upcoming next major release of the java driver that has a wrapper over Cassandra Cluster Manager (ccm) for running C* and DSE processes to facilitate testing, in addition to some JUnit rules for making it easy to incorporate in tests.   There isn't much documentation to be found around using this yet, but you can find some examples of its use in our integration tests.
  • java-driver tests jar:  In our current version of java driver (3.x), we also deploy a 'test' classifier jar to maven which includes CcmBridge which is a similar concept to java-driver-test-infra.
These might not be an option for you since you mentioned TitanDB (which uses Thrift still, I think?), but there are also a couple of libraries out there that implement the C* native protocol interface as a way of simulating a C* server:
  • scassandra - 'Simulated Cassandra'.  Supports protocol versions 1 through 4.  Allows you to run in JVM simulated endpoints that resembles C*.  Also has an HTTP interface so its use is limited to java.   java driver 3.x uses it in its testing to test scenarios that are difficult to reliably produce with real C* nodes.
  • simulacron - A similar concept to scassandra, with focus on simulating large clusters.  Supports protocol versions 3 and 4 (C* 2.1+)
Thanks,
Andy

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

gw

unread,
Mar 12, 2018, 10:53:20 AM3/12/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Andy,

Thanks for the extensive info!  Just to make sure I understand what you're saying pertaining to running DSE graph embedded with client application - I am comparing it to the execution model available in TitanDB, where you can run as either:
1) embedded in the Java application (in the same JVM), or
2) external server

In both of these cases graph db connects to external C* node(s).  As I understand your answer, option #1 is not available in DCE Graph. Again, just making sure I am not missing anything.

Best,
~gw

Andy Tolbert

unread,
Mar 12, 2018, 10:58:54 AM3/12/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Gw,

That is correct,  there is no option to run DSE Graph embedded with a client application.

Thanks!
Andy

--
Reply all
Reply to author
Forward
0 new messages