Migrating from Neo4J to DataStax Graph DB (DSE) - java

We have developed custom and proprietary Software for Route Optimization,
using Neo4J as our Graph DB. We also developed few plugins and unmanaged Extensions in Java, that implement specific Business Logic whenever search is done on the Graph. Since we are facing severe Performance Issues with Neo4J, we are considering to migrate our proprietary Software from Neo4J to DataStaX DSE 5.0 Graph. But would like to evaluate DSE Graph initially.
We have few specific questions
regarding Migration Path from Neo4J --> DataStax Graph DB
How to migrate data from Neo4J to DataStax Graph DB?
What are the changes we need to make in Neo4J Cypher Code in our Application so that it will work on DataStax DSE Graph DB?
We have developed some Plugins/Unmanaged Extensions in Neo4J using Java which have lots of core business rules incorporated into Neo4J. Our business logic code in Java gets called whenever Neo4J searches/traverses graph database. Does DataStax DSE Graph support something similar to plugins and/or unmanaged Extensions?
We would like to see what it takes to migrate our existing Neo4J Java code to DataStax DSE Graph code. We need to determine the level of effort would involved to do this exercise before we could be up and running on DataStax DSE Graph.

This might help: http://www.tinkerpop.com/docs/3.0.0.M1/#neo4j-gremlin
You can essentially connect to your Neo4J instance via the gremlin console, get the data you'd like, and write it out to a file that can be loaded into DSE Graph. That looks something like
graph.io(IoCore.gryo()).writeGraph("tinkerpop-modern.kryo");
See: http://www.tinkerpop.com/docs/3.0.0.M1/#gremlin-kryo
There's a lot to your question, especially around design, that can't be accurately answered in a StackOverflow post since a lot of it is specific to your use case. I suggest reaching out to DataStax directly for those questions, they'll be happy to help. That being said, I will be upfront with you, Neo4J and DSE Graph are very different systems. As such, you may have to rethink schema design as well as application code design.
If you're already familiar with Cassandra, that helps quite a bit around the architecture side. Even so, I do recommend checking out some of the free training around DSE Graph, specifically: https://academy.datastax.com/courses/ds330-datastax-enterprise-graph

Related

How to connect to a JanusGraph with dynamodb backend using Java Client Code?

I am trying to build a Java application which uses JanusGraph(with dynamodb backend) which is hosted on a remote machine and has gremlin server started.
I want to know what my options are when writing a client for this setup!!
1) Any OGM like FERMA. Looks like there is no support.
2) Use gremlin java driver and write the client code using Cluster Class.
3) Anything else ?
I am the lead developer on Ferma.
Obviously I am a bit bias but ferma has fairly complete documentation (I hope), and we always respond on gitter and to issues within 24 hours. So support shouldnt be much of a problem.
I havent seen any complete OGM options outside of Ferma but there are a few obsolete projects like totorom, frames, peapod, and similar you may want to look at. I am afraid they will have even less support than ferma though.
To your question, to connect to JanusGraph there are several options depending on the framework you using. You basically configure any options you need in the JanusGraphFactory then connect to the desired host with the following call. Then just pass this graph object into the constructor of a FramedGraph.
Graph graph = JanusGraphFactory.open('cassandra:localhost')

Choosing Apache Cassandra client

There is a bunch of different cassandra's clients in now days. Most of them was built on top of Thrift driver and then adopted to use DataStax Java driver. I can name Kundera and Astynax as biggest of them. The last one has only a beta support for the Java driver. And there is an Achilles client that build on top of DataStax Java driver and supports all new Cassandra features. It's a little bit younger and I know nothing of it's use cases in production. But it looks very promising.
So I'm new in NoSQL world ask you to give me a hint - with client to use with new project? Suppose it will be a big solution with 33 nodes Cassandra cluster and a lot of different kinds of queries to db.
Thank you in advance.
If the platform you're on has a client from DataStax, use that. The DataStax drivers for the jvm and .NET (and possibly others) are quite polished, support all available features, and deal with connection complexity internally very nicely. In addition, if you're looking to do Spark analytics, the DataStax Spark connector is the only option supporting good locality, and it uses the DataStax java driver internally.

How to get Java to access Cassandra 1.0.10

Can anyone recommend a good way to create scripts in java that will work with an older Cassandra 1.0.10 database? I'm having trouble finding stuff online. Is thrift a type of driver?
Thanks!
Apache Thrift is way to connect to the Cassandra RPC server 1).
In the Cassandra source three there is a file /interface/cassandra.thrift which is an interface description file (IDL) that can be fed to the Apache Thrift compiler in order to generate Java code. By means of this Java code you will be able to access Cassandra. The whole process is described in more detail in the Cassandra wiki.
However, it is recommended to use a more high-level client library instead, because the raw Cassandra API is quite complex. You'll find the existing libraries, such as Hector, much more handy for your task.
1) Some more details about Thrift can be found in this answer.

Neo4j 2.0 with Eclipse Java

I want to interact with remote Neo4j server 2.0 version from Eclipse Java program. Can some one tell me,what tools and libraries do I need to achieve this.
Please note that it need to interact with remote DB server and not the embedded Noe4j. Please advise.
Check out the Neo4j JDBC driver. That should work best for your purposes:
https://github.com/neo4j-contrib/neo4j-jdbc/tree/2.0
If you've worked with a JDBC driver before it should be as easy. Just make sure to use parametrized PreparedStatement for your queries.
There are a few other options as well:
The native Neo4j REST API. Docs are here: http://docs.neo4j.org/chunked/stable/rest-api.html and an example is here: https://github.com/jimwebber/neo4j-tutorial/blob/master/src/koan/java/org/neo4j/tutorial/advanced/BasicRestApiFormerlyKoan10.java (check out the entire Koan project; it's a fantastic way to get really familiar with Neo4j's Java libs). The example makes use of a Jersey client to call out to the Neo4j server.
https://github.com/neo4j/java-rest-binding - The URL should speak for itself. There are tags for Neo4j 2.0 as well. This binding essentially wraps the above in a nice, neat package. Beats having to write your own wrapper.
Spring Data for Neo4j (http://projects.spring.io/spring-data-neo4j/). If you're using Spring in your Java development, this is definitely worth a look. The update for Neo4j 2.0 just came out a few weeks ago and should be ready for production very soon. There are pros and cons to using SDN, but, it's super easy to use, especially if you don't need anything overly complicated.
Hope this helps!

Rapid developement of java web-app, using existing mongo database

Want to fast implement little web-app using:
Spring MVC
GWT for frontend
Hibernate
Maven
(found that Spring Roo provide most of needed architecture)
Problem is, I have exiting Mongo database.
Is any way to create data schema from existing mongo database (found reverse engineering for relational databases)? Or i have to define entities, according to mongo db by hand?
We've once tried to pursue a rapid prototyping approach for an auto-generated backend based on an existing MongoDB database. The code is open source and available at http://sourceforge.net/projects/springmorphia/
Disclaimer:
This is a student's bachelor thesis, so you might want to review the code.
We've never used it for its intended purpose, since we were not too thrilled with Spring Roo (specifically the stability of the API, number of bugs we ran into,...).
However, this project is more than a year old, so things might have improved. Which also means that the Spring Roo version is heavily outdated.
It's probably a good starting point if you want to head in that direction.
If you don't intend to use a rapid prototyping approach, I'd still rebuild the database once and import the existing data. Only if you want to continuously generate your code based on an evolving database it will pay of, IMHO.

Categories

Resources