Lunch and learn cypher
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Lunch and learn cypher

on

  • 663 views

Easy introduction to the Neo4j graph database using the Cypher query language.

Easy introduction to the Neo4j graph database using the Cypher query language.

Statistics

Views

Total Views
663
Views on SlideShare
663
Embed Views
0

Actions

Likes
2
Downloads
29
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Much richer data than flat history\nCan replay a user’s browsing session step-by-step\nExperimental features examples: recommendations, which pages to omit, etc.\n
  • Much richer data than flat history\nCan replay a user’s browsing session step-by-step\nExperimental features examples: recommendations, which pages to omit, etc.\n
  • Visualization done with GraphViz\nA user will have many such “stacks”\n
  • Search ranking weighs inbound and outbound node connections as part of search score calculation\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Lunch and learn cypher Presentation Transcript

  • 1. Lunch and Learn Neo4jAndreas Kollegger@akollegger#neo4j 1
  • 2. Lunch and Learn Neo4jAndreas Kollegger@akollegger#neo4j 1
  • 3. Lunch and Learn Neo4jAndreas Kollegger@akollegger#neo4j 1
  • 4. 1
  • 5. Graph DB 101 2
  • 6. 3
  • 7. You know relational 3
  • 8. You know relational 3
  • 9. You know relational foo 3
  • 10. You know relational foo bar 3
  • 11. You know relational foo foo_bar bar 3
  • 12. You know relational foo foo_bar bar 3
  • 13. You know relational foo foo_bar bar 3
  • 14. You know relational foo foo_bar bar 3
  • 15. You know relationalnow consider relationships... 3
  • 16. You know relationalnow consider relationships... 3
  • 17. You know relationalnow consider relationships... 3
  • 18. You know relationalnow consider relationships... 3
  • 19. You know relationalnow consider relationships... 3
  • 20. You know relationalnow consider relationships... 3
  • 21. 3
  • 22. 4
  • 23. Were talking about aProperty Graph 4
  • 24. Were talking about aProperty Graph Nodes 4
  • 25. Were talking about aProperty Graph Nodes Relationships 4
  • 26. Were talking about aProperty Graph Em Joh il a n knows knows Alli Tob Lar Nodes son ias knows s knows And And knows knows rea rés s knows knows knows Pet Miic Mc knows Ian er knows a a knows knows De Mic lia h ael Relationships Properties (each a key+value) + Indexes (for easy look-ups) 4
  • 27. 4
  • 28. 5
  • 29. Webadmin 5
  • 30. 6
  • 31. Cypher - a graph query language๏ a pattern-matching query language๏ declarative grammar with clauses (like SQL)๏ aggregation, ordering, limits๏ create, read, update, delete 6
  • 32. Cypher - a graph query language๏ a pattern-matching query language๏ declarative grammar with clauses (like SQL)๏ aggregation, ordering, limits๏ create, read, update, delete // get node with id 0 start a=node(0) return a // traverse from node 1 start a=node(1) match (a)-->(b) return b // return friends of friends start a=node(1) match (a)--()--(c) return c 6
  • 33. Neo4j - the Graph Database 7
  • 34. With love, from Sweden๏ 2001 - a Swedish media asset project •CTO Emil prototyped a proper graph interface •first SQL-backed, then revised down to bare metal •(just like Amazon->Dynamo, Facebook->Cassandra, Google-> Big Table, Sweden->Neo4j)๏ 2003 Neo4j went into 24/7 production๏ 2006-2007 - Neo4j was spun off as an open source project๏ 2009 seed funding for the company๏ 2010 Neo4j Server was created (previously only an embedded DB)๏ 2011 Series-A Funding, Top-Tier customers (gratuitous name dropping) 8
  • 35. Neo4j is a Graph Database 9
  • 36. Neo4j is a Graph Database๏ A Graph Database: 9
  • 37. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both 9
  • 38. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both • perfect for complex, highly connected data 9
  • 39. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both • perfect for complex, highly connected data๏ A Graph Database: 9
  • 40. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both • perfect for complex, highly connected data๏ A Graph Database: • reliable with real ACID Transactions 9
  • 41. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both • perfect for complex, highly connected data๏ A Graph Database: • reliable with real ACID Transactions • scalable: 32 Billion Nodes, 32 Billion Relationships, 64 Billion Properties 9
  • 42. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both • perfect for complex, highly connected data๏ A Graph Database: • reliable with real ACID Transactions • scalable: 32 Billion Nodes, 32 Billion Relationships, 64 Billion Properties • Server with REST API, or Embeddable on the JVM 9
  • 43. Neo4j is a Graph Database๏ A Graph Database: • a Property Graph with Nodes, Relationships and Properties on both • perfect for complex, highly connected data๏ A Graph Database: • reliable with real ACID Transactions • scalable: 32 Billion Nodes, 32 Billion Relationships, 64 Billion Properties • Server with REST API, or Embeddable on the JVM • high-performance with High-Availability (read scaling) 9
  • 44. the Real World 10
  • 45. 11
  • 46. Real World Use Cases: 11
  • 47. Real World Use Cases:• [A] Mmm Pancakes 11
  • 48. Real World Use Cases:•[A] Mmm Pancakes• [B] ACL from Hell 11
  • 49. Real World Use Cases:•[A] Mmm Pancakes• [B] ACL from Hell• [C] Master of your Domain 11
  • 50. [A] Mmm Pancakes
  • 51. [A] Mmm Pancakes
  • 52. [A] Mozilla PancakeThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 53. [A] Mozilla Pancake • Experimental cloud-based browser • Built to improve how users Discover, Collect, Share & Organize things on the web • Goal: help users better access & curate information on the net, on any deviceThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 54. This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 55. Why Neo4J?This Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 56. Why Neo4J? • The internet is a network of pages connected to each other. What better way to model that than in graphs? • No time lost fighting with less expressive datastores • Easy to implement experimental featuresThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 57. Cute meta + dataThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 58. Cute meta + dataThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 59. Neo4J Co-Existence • Node uuids as refs in external ElasticSearch also in internal Lucene • Custom search ranking for user history based on node relationship data • MySQL for user data, Redis for metricsThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 60. Mozilla Pancake Available on BitBucket: https://bitbucket.org/ mozillapancake/pancake Questions? Olivier Yiptong: oyiptong@mozilla.comThis Material is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of theMPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/
  • 61. [B] ACL from HellOne of the top 10 telcos worldwide
  • 62. BackgroundTelenor calculated in 2010 that it´s self-service web solution forcompanies, MinBedrift, would not scale with the projectedcustomer and subscription growth beyond 2012. Limit th G row ted jec Pro 2010 2015
  • 63. [B] Telenor BackgroundBackgroundTelenor calculated in 2010 that it´s self-service web solution forcompanies, MinBedrift, would not scale with the projectedcustomer and subscription growth beyond 2012. Limit th G row ted jec Pro 2010 2015
  • 64. [B] Telenor Background• MinBedrif, a self service web solution for companies Background• 2010 - calculated that it would not Telenor calculated in 2010 that it´s self-service web solution for scale with projected growth companies, MinBedrift, would not scale with the projected customer and subscription growth beyond 2012. Limit th G row ted jec Pro 2010 2015
  • 65. Business CaseThe business case is built on the negative consequence of NOTaddressing the problem. Loss of customers (income) Reduced sales transactions (income) Increased manual support (expenses) Other
  • 66. 21
  • 67. Current ACL Service 21
  • 68. Current ACL Service๏ Stored procedure in DB calculating all access •cached results for up to 24 hours •minutes to calculate for large customers •extremely complex to understand (1500 lines) •depends on temporary tables •joins across multiple tables 21
  • 69. Example Access Authorization UserAccess may be given directly or by inheritance Customer Account U Subscription U Inherit = true Inherit = false In C he rit =C C C tru e A A A A A S S S S S S S S S S
  • 70. 23
  • 71. ACL With Neo4j 23
  • 72. ACL With Neo4j๏ Faster than current solution๏ Simpler to understand the logic๏ Avoid large temporary tables๏ Tailored for service (resource authorization) 23
  • 73. [C] Master of your Domain
  • 74. [C] MDM within Ciscomaster data management, sales compensation management, online customer supportDescription BenefitsReal-time conflict detection in sales compensation management. Performance : “Minutes to Milliseconds”Business-critical “P1” system. Neo4j allows Cisco to model complex Outperforms Oracle RAC, serving complex queries in real timealgorithms, which still maintaining high performance over a large Flexibilitydataset. Allows for Cisco to model interconnected data and complex queries with easeBackground RobustnessNeo4j replaces Oracle RAC, which was not performant enough for the With 9+ years of production experience, Neo4j brings a solid product.use case.Architecture3-node Enterprise cluster with mirroreddisaster recovery clusterDedicated hardware in own datacenterEmbedded in custom webappSizing35 million nodes50 million relationships600 million properties
  • 75. 26
  • 76. Really, once you start thinking in graphs its hard to stop Recommendations MDM Business intelligence Geospatial catalogs Systems access control Social computingManagement your brain Biotechnology routing genealogylinguistics Making Sense of all that compensation data market vectors 26
  • 77. Really, once you start thinking in graphs its hard to stop What will you MDM Recommendations build? Business intelligence Geospatial catalogs Systems access control Social computingManagement your brain Biotechnology routing genealogylinguistics Making Sense of all that compensation data market vectors 26
  • 78. 27
  • 79. Neo4jand, Thanks :) 27