Sharing my playbook for graph database projects. Will be happy to answer any questions or offer advice.\n\nAsk Siri who is the quarterback of the New York Jets and you get a list of the current quarterbacks right away. Ask Siri who is Taylor Swift’s boyfriend, and it will know.\n\nAsk who are the members of the Irish band, The Chieftains, and Siri doesn’t know. Even if you ask about who are the members of the Irish Band U2, it doesn’t know. It can provide you information about Bono, but doesn’t have an idea of the members of U2.\n\nHowever, Google Assistant know to answer the questions above. Can you guess what happened?\n\nDespite an almost 50% growth YoY of graphs, the tech sees a small fraction of the database market share. Yet it’s power, flexibility and speed of development reamins amongst one of the best. Better yet, it leads the way to use cases that are beyond the grip of any other system i have worked with.\n\n!(https://hackernoon.com/hn-images/1*vVxPojYVfrHXlrlfExMw1w.png)\n\nSource: [https://db-engines.com/en/ranking](https://db-engines.com/en/ranking)\n\nAs an independent consultant for the past 7 years, i have produced a playbook that can help you levrage the power of graphs in 5 days. Think of it as a high-performance factory. Below, you’ll find the needed steps and how to go about them.\n\nLet’s have a look at how your company or product can levrage this tech. What are the steps you can go through, and what results can be expected at the very end of this process?\n\n#### Overview\n\n1. Import your current data\n2. Basic queries\n3. Handle data duplication\n4. Network Analytics/Advanced graph algos\n5. Deployment\n\n!(https://hackernoon.com/hn-images/1*XGZa_Z7KwjRxyAqb9qGOSg.png)\n\n#### 1\\. Import\n\nYou already have one or several databases(mysql/postgresql, mongodb, Cassandra, etc.). The goal of this stage is to explore the current structure of your data and translate it into a graph. Part of this stage is also known as ETL(Extract-Transform-Load).\n\nIf working with an external consultant, make sure to encrypt/obfuscate sensitive data and get an NDA in place, before handing it over.\n\nUsing the right tools, this can happen in under one day. Naturally, actually loading the data in the graph may vary, timewise. Expect to let the system run for about 30 minutes for each 10GB. It’s quite rare that all the data needs to be imported, so good communication before starting the work goes a long way.\n\n!(https://hackernoon.com/hn-images/1*1RIKJa2oAXLRyuMsZVrC8A.jpeg)\n\nFrom 2 tables in a relational database, to nodes and relationships in a graph database.\n\n!(https://hackernoon.com/hn-images/1*3MmamxpygRzjZ71-cY8xVA.jpeg)\n\n**Side-effect bonus**: Non-technical people can understand the structure of the data, as graph databases are very whiteboard friendly.\n\n#### 2\\. Basic queries\n\nWe need to keep our new data in sync, so we need to connect existing actions that create, update or delete items in your tabular db system to the new graph database.\n\nIn this step, we simply evaluate your current SQL queries, and translate them to Cypher.\n\nThis step usually spurs some very nice Aha moments. What was impossible in the tabular view(doing 5 joins in a row, in real-time) is now highly achievable.\n\nIf we’re talking about 10 queries and 4 pipelines that need to also direct the data to the graph, this can happen in one day. Otherwise, it might vary.\n\n**Testing** can be done by running two systems in parallel. Let’s name the two databases SQL1 and Neo2. Here is how you would test you got this step right:\n\n1. Do an import from SQL1 to Neo2.\n2. Apply a sequence of queries to both systems. Example: Query1, Query2, Query1 to SQL1 and GraphQuery1, GraphQuery2, GraphQuery1 to Neo2.\n3. Do an import of SQL1 to Neo2. Assert that the 2 databases contain the same data.\n\n**Benchmarking** the two systems will prove which one handles certain queries better. Some functionality previously unattainable with SQL will become possible with Cypher.\n\n**Side-effect bonus**: An understanding of how graphs work. The first new possibilities start to unravel.\n\n#### 3\\. Data duplication\n\nTake the queries in step 2, and connect them to your current systems. These could be methods that handle http calls in your microservices, database triggers, etc.\n\nBe sure to use threads, or some async mechanism, so submission of the data to the databases happens in parallel.\n\nHint: if updating Neo4j in real-time is not a priority(using it for analytical capabilities, to present aggregates of the info, recommender system that does not need fresh data, etc) you can use a smaller database instance and use a queue(Kafka, RabbitMQ) to throttle the update/usage.\n\n#### 4\\. Network analytics and advanced graph algorithms\n\nI have applied over 200 algorithms on top of graphs. It’s science, yes, but it’s also about having the intuition of what is possible and knowing how to ask the right question(just like in real life).\n\nIn my consulting projects, only once have i had to write a complex algorithm from scratch. Usually, you will find everything you need, under a permissive Open Source license.\n\nIf your engineers know what they’re doing, this can take less than 2 days.\n\nFor an in-depth dive and some intuition on what can be achieved, have a look at the [top 5 interesting applications of graph databases](https://medium.com/@mihairaulea/top-5-applications-of-graph-databases-b186c3105fd1).\n\n#### 5\\. Deployment\n\n**Deploying to the cloud is a hot topic nowadays, and LinkedIn predicts that the hottest skill for techies this year will be cloud knowledge.** While building the Chinese version, LinkedIn used Neo4j, the leading graph database. Their conclusion was that they were able to move very fast, and didn’t have the need for a database administrator.\n\nDeployment to a managed cloud service can happen in a couple of hours. Deploying your own pipe can take a couple of days.\n\nLast tip: while you won’t be needing an administrator, you will be needing a cloud deployment, and i use [GrapheneDB](https://www.graphenedb.com/) for most of my projects.\n\nGood luck, i wish the new functionality you build returns an astronomical ROI. If you want to make sure, [hire me now](https://mihairaulea.github.io/GraphConsultingServices/)!