Neo4j spatial-nosql-frankfurt

8,474 views
8,328 views

Published on

0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,474
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
182
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide
  • The current success and popularity of NoSQL data models has been driven by the internet, and the associated explosion in the volume and interconnectedness of data.
  • EE
  • This example does highlight a few things about semi-structured data, schema-less databases and even opens the conversation for some discussions on performance (implicit indexes through local search, etc.)
  • Lightweight and embedded: single jar of ~500k [demo]
  • Fully transactional: ie complete ACID, supports JTA/JTS, 2PC, deadlock detection, transaction recovery and all the rest [demo]
  • Lightweight and embedded: single jar of ~500k [demo]
  • • includes high performance graph algorithms • routes with live changing data • integrates easily with any domain graph
  • • traverses millions of friends per second • maps directly to friend-of-a-friend • quickly performs deep recommendations
  • • explores what-if failures • reveals root cause • determines actual operating cost
  • • can handle billions of ad-hoc relationships • traverses millions of nodes per second • maps directly to your MDM domain
  • Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  • Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  • Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  • Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  • Neo4j spatial-nosql-frankfurt

    1. 1. Neo4j Spatial GIS for the rest of us #neo4j Peter Neubauer @peterneubauer peter@neotechnology.com Neo Technology
    2. 2. NOSQL data models Key-value stores Data size Bigtable clones Document databases Graph databases Data complexity
    3. 3. The Neo4j model: Property Graph Core abstractions: name = “Emil” Nodes age = 29 sex = “yes” Relationships between nodes Properties on both 1 2 type = KNOWS time = 4 years 3 type = car vendor = “SAAB” model = “95 Aero”
    4. 4. Neo4j – Nodes, Relationships, Properties Nodes have different properties Matrix characters: People vs. Programs Build structure as you go Who loves Neo?
    5. 5. Building a node space GraphDatabaseService graphDb = ... // Get factory // Create Thomas 'Neo' Anderson Node mrAnderson = graphDb.createNode(); mrAnderson.setProperty( "name", "Thomas Anderson" ); mrAnderson.setProperty( "age", 29 ); // Create Morpheus Node morpheus = graphDb.createNode(); morpheus.setProperty( "name", "Morpheus" ); morpheus.setProperty( "rank", "Captain" ); morpheus.setProperty( "occupation", "Total bad ass" ); // Create a relationship representing that they know each other mrAnderson.createRelationshipTo( morpheus, RelTypes.KNOWS ); // ...create Trinity, Cypher, Agent Smith, Architect similarly
    6. 6. Building a node space GraphDatabaseService graphDb = ... // Get factory Transaction tx = graphdb.beginTx(); // Create Thomas 'Neo' Anderson Node mrAnderson = graphDb.createNode(); mrAnderson.setProperty( "name", "Thomas Anderson" ); mrAnderson.setProperty( "age", 29 ); // Create Morpheus Node morpheus = graphDb.createNode(); morpheus.setProperty( "name", "Morpheus" ); morpheus.setProperty( "rank", "Captain" ); morpheus.setProperty( "occupation", "Total bad ass" ); // Create a relationship representing that they know each other mrAnderson.createRelationshipTo( morpheus, RelTypes.KNOWS ); // ...create Trinity, Cypher, Agent Smith, Architect similarly tx.commit();
    7. 7. Code (2): Traversing a node space // Instantiate a traverser that returns Mr Anderson's friends Traverser friendsTraverser = mrAnderson.traverse( Traverser.Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_START_NODE, RelTypes.KNOWS, Direction.OUTGOING ); // Traverse the node space and print out the result System.out.println( "Mr Anderson's friends:" ); for ( Node friend : friendsTraverser ) { System.out.printf( "At depth %d => %s%n", friendsTraverser.currentPosition().getDepth(), friend.getProperty( "name" ) ); }
    8. 8. Ruby gem install neo4j require ”rubygems” require 'neo4j' class Person include Neo4j::NodeMixin property :name, :age, :occupation index :name has_n :friends end Neo4j::Transactoin.run do neo = Person.new :name=>'Neo', :age=>29 morpheus = Person.new :name=>'Morpheus', :occupation=>'badass' neo.friends << morpheus end neo.friends.each {|p|...}
    9. 9. Routing
    10. 10. Social graphs
    11. 11. Impact, Dependency Analysis
    12. 12. Master Data Management
    13. 13. Why Spatial? Complex data Multiple indexing (domain, Spatial, temporal) Location entering many domains GIS going mainstream, topologies explode No good systems out there Proprietary stacks rule (ESRI, Oracle) Open Government Data Shapefiles suck.
    14. 14. Persistence backends in GIS Shapefiles PostGIS MySQL Oracle Spatial ESRI GeoCouch Cassandra (?) Neo4j Spatial
    15. 15. Current challenges in Spatial Domain and Spatial interconnections Unstructured domain data Routing Topology handling No good OSS full GIS stack
    16. 16. The Neo4j Spatial stack OpenLayers PHP AJAX WMS Editing JS WMF C# Rails Spring Django Roo GeoServer uDig GeoMaya REST Java Scripting GeoTools Neo4j Spatial Neo4j
    17. 17. OpenStreetMap
    18. 18. The OpenStreetMap dataset Wiki for Spatial info Freely available data Very unstructured, free tagging Points, Ways, Relations, Tags, Changesets Changes can be pushed back Used for other purposes Great coverage in interesting places (towns, disasters etc)
    19. 19. OpenStreetMap
    20. 20. OpenStreetMap
    21. 21. GSoC 2010 Davide Savazzi Geotools & GeoServer Routing uDig
    22. 22. Connecting and Splitting Layer1 Layer1 Layer2 Layer2 Layer3 Layer3 Why have layers at all? Simpler renderers Historical Data sources
    23. 23. GSoC 2010 - Routing
    24. 24. Connecting and Splitting Routing OSM Dynamic Layers
    25. 25. GSoC 2010 - uDig
    26. 26. Neo4j dynamic layers Geometry Layer1 Encoder Dynamic Query Layer2 Dynamic Styles Layer3 Dynamic Meta-Inf Connected domain data Neo4j Spatial GIS and Spatial stacks
    27. 27. OpenStreetMap Dynamic OSM Laye rs Inde x (RTre e )
    28. 28. Dynamic Layers
    29. 29. Dynamic Layers
    30. 30. Dynamic Layers
    31. 31. Future Complex spatial mapping and analytics made easy Editing Fine Grained Geotools Feature Editing OSM Editor OSM Caching sub-graphs (desktop & mobile) More Dynamic Layers & Shapefile export Topology Persist all topological results in graph Benchmarking & Performance Improved indexing Composite index
    32. 32. API References Wiki, Code, API references http://wiki.neo4j.org/content/Neo4j_Spatial http://github.com/neo4j/neo4j-spatial http://components.neo4j.org/neo4j-spatial Mailing list: neo4j@lists.neo4j.org http://neo4j.org/community/list/
    33. 33. Questions? Image credit: lost again! Sorry :(
    34. 34. http://neotechnology.com

    ×