Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Interpreting Relational Schema to Graphs

430 views

Published on

Praveena Fernandes (Neo4j) discusses the benefits of graphs vs. relational databases and demos the RDBMS-to-Neo4j ETL Tool.

Published in: Technology
  • Be the first to comment

Interpreting Relational Schema to Graphs

  1. 1. / (..) ‘[*]’ || @praveenasekhar SOFTWARE ENGINEER @ NEO4j
  2. 2. MOTIVATION
  3. 3. 1. Why neo4j over relational database? @praveenasekhar
  4. 4. @praveenasekhar You store to looK up & use it later
  5. 5. Organising data in tables and relationships between the data through keys and constraints restricts easy lookup @praveenasekhar
  6. 6. Person belongs to departments
  7. 7. Interpreting relational schema as graph: Person belongs to departments
  8. 8. Interpreting relational schema as graph: Person belongs to departments
  9. 9. Relational vs graph
  10. 10. 2. Neo4j is whiteboard friendly @praveenasekhar
  11. 11. Mastering data modelling
  12. 12. Conceptual model
  13. 13. Logical model
  14. 14. Physical model
  15. 15. Building relational models: Expectation Talk: “data modelers still have jobs adjusting for the nosql environment” Joe Maguire Data modeling emerged in the 1970’s in response to the needs of database Mastering Data Modeling: A User Driven Approach
  16. 16. Building relational models: Expectation Talk: “data modelers still have jobs adjusting for the nosql environment” Joe Maguire Data modeling emerged in the 1970’s in response to the needs of database Mastering Data Modeling: A User Driven Approach
  17. 17. Building relational models: REALITY Talk: “data modelers still have jobs adjusting for the nosql environment” Joe Maguire Data modeling emerged in the 1970’s in response to the needs of database Mastering Data Modeling: A User Driven Approach
  18. 18. Neo4j is better at expressing what relational schema tries to emulate Entities -> nodes/labels Attributes -> properties Relationships -> relationships Identifiers -> constraints
  19. 19. Psst. it’s whiteboard friendly ;) @praveenasekhar
  20. 20. Neo4j is whiteboard friendly Whiteboard Neo4j Praveena Neo4j WORKS_AT @praveenasekhar
  21. 21. 3. How do you model in neo4j @praveenasekhar
  22. 22. Relational vs graph MySql Neo4j @praveenasekhar
  23. 23. Relational vs graph MySql Neo4j @praveenasekhar
  24. 24. Relational vs graph MySql Neo4j @praveenasekhar
  25. 25. 4. Neo4j is schema optional @praveenasekhar
  26. 26. Nodes, Labels, Properties, and Relationships. @praveenasekhar
  27. 27. Neo4j is schema optional
  28. 28. I’m excited about NEO4j. How do I get work with Neo4j?
  29. 29. neo4j-etl
  30. 30. ● Interpret Schema as graphs ● Import { MySQL, postgres, oracle, Db2, Sql Server, Cassandra } database ● Any database with a JDBC driver that exposes metadata
  31. 31. Configure connection Configure connection url ● Postgres ● Mysql Start mapping Select your database connection to map to your neo4j instance Make edits and save mapping Edit the mapping, relationship name, table name to your liking Import your data Into Neo4j You can import your data using one of the many tools ● neo4j-import ● neo4j-shell ● cypher-shell ● cypher
  32. 32. Demo
  33. 33. Configure Connection
  34. 34. Start Mapping
  35. 35. Make edits and save mapping
  36. 36. Import your data into Neo4j
  37. 37. Imported successfully
  38. 38. Schema interpretation rules A table with a foreign key is treated as a Join and imported as a node with a relationship
  39. 39. Schema interpretation rules A table that has two foreign keys is imported as a JoinTable and imported as a relationship
  40. 40. Schema interpretation rules A table that has more than two foreign keys is treated as an intermediate node and imported as node with multiple relationships
  41. 41. mapping file
  42. 42. Data Extraction and CSV Writes
  43. 43. neo4j-import $./neo4j-enterprise-3.0.1/bin/neo4j-import --into /tmp/neo4j-enterprise-3.0.1/data/databases/graph.db --nodes /tmp/csv-003/javabase.Book_headers.csv,/tmp/csv-003/javabase.Book.csv --nodes /tmp/csv-003/javabase.Author_headers.csv,/tmp/csv-003/javabase.Author.csv .. --relationships /tmp/csv-003/javabase.Book_Author.csv
  44. 44. Migrated db
  45. 45. tools used ● Jdbc ● Schema crawler ● neo4j-import, cypher-shell, neo4j-shell, cypher
  46. 46. Designed for extension
  47. 47. Load csv, Apoc procedures, neo4j-import, and neo4j-admin
  48. 48. Conclusion People interpret the world in predefinedstructures that make sense to them and experience it that way. But as they begin to explore it you will notice the anomaliesand special case that makes it beautifulthe way it is.. Which is why we need a database to reflect the same.
  49. 49. Adapt predefined structures and rules yet be forgiving when rules don’t apply.
  50. 50. Try Neo4j! https://neo4j.com/download/
  51. 51. Links Github: https://github.com/neo4j-contrib/neo4j-etl-components https://github.com/neo4j-contrib/neo4j-etl-components/issues Documentation http://neo4j-contrib.github.io/neo4j-etl-components/ Blog https://neo4j.com/blog/rdbms-neo4j-etl-tool/ https://neo4j.com/developer/guide-import-csv/ https://neo4j.com/developer/guide-importing-data-and-etl/ https://neo4j.com/developer/guide-import-csv/
  52. 52. / (..) ‘[*]’ || @praveenasekhar SOFTWARE ENGINEER @ NEO Thank you :)

×