Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import data from sql to neo4j

I have developed a .net project which has a SQL database. I want to know is there any way, that I can import my SQL DB file into the neo4j database directly?

like image 226
user862226 Avatar asked Dec 20 '22 23:12

user862226


1 Answers

Chris Skardon is right, you might want to iron out the categories a little bit. Neo4j is not a graph layer on top of a relational database, it is a competing/complementary kind of database. While it's possible to imitate your relational schema in Neo4j, its probably not very useful, and you will likely have to do a some remodeling to benefit from using Neo4j.

If you decide you do want to transfer data from your SQL database to Neo4j, but prefer not to code the actual import yourself, here are some tips and tools to look at. (I apologize for the list being so Java-centric, but I haven't interacted with Neo4j from .NET yet––I'm sure someone else here can help.)

  • Export SQL to CSV, import into Neo4j with Michael Hunger's Batch CSV Importer with some Guidance From Max De Marzi
  • Export SQL to spreadsheets and follow Instructions Here to import to Neo4j
  • Use an ETL tool like Pentaho Kettle with the Neo4j JDBC Driver
  • Use a framework for object mapping (perhaps similar to your Linq), such as Spring Data. There is Spring Data Neo4j for what they call object graph mapping, and you can even divide your domain objects over different families of database backends, so called Cross Store Persistence

I would, however, humbly recommend writing as much of your own code as possible for interacting with Neo4j. Probably someone else has done it better (at least that's what I tend to find) but writing it yourself will greatly enhance your understanding of the database and APIs and you will get much better mileage when you really know how to drive.

like image 129
jjaderberg Avatar answered Dec 27 '22 12:12

jjaderberg