SlideShare a Scribd company logo
1 of 43
Download to read offline
Neo4j
And TelCo goodness
                 Some usecases


                                 #neo4j
Peter Neubauer                   @peterneubauer
                                 peter@neotechnology.com
Neo Technology
NOSQL data models
            Key-value stores
Data size




                          Bigtable clones


                                            Document
                                            databases


                                                           Graph databases




                                                        Data complexity
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”
Agenda
 The NoSQL landscape
 Neo4j intro
 Examples for TelCos
   CDR
   Routing
   Social graphs
   Master Data Management
   Spatial and LBS
   Network topology analysis
   Neo4j and Android
Neo4j?
 Most widely deployed graph db in the world
   ACID, persistent, embedded/server
   Robust: 24/7 production since 2003
   Mature: lots of production deployments
   Scalable: High Availability, Master failover
   Community: ecosystem of tools, bindings, frameworks
   Product: OSGi, Spatial, RDF, languages

 Available under AGPLv3 and as commercial product
   But the f rst one is free! For ALL use-cases.
           i
 Links
   http://neo4j.org
   http://lists.neo4j.org
Neo4j – Nodes, Relationships, Properties




 Nodes have different properties
   Matrix characters: People vs. Programs
 Build structure as you go
    Who loves Neo?
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
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();
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" ) );
}
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|...}
Spatial and social data
                                                                        name = ...

                          name = “The Tavern”
                          lat = 1295238237
name = “Omni Hotel”
                          long = 234823492                                                42
lat = 3492848
long = 283823423                              length = 7 miles                     AD
                                                                              RO
                  ROAD                         ROAD                             ROO
     1                                 7                            3              OAD


                  RO
                                                                                            13
                     AD                               name = ...
                                       ROAD
                                                      lat, long = ...
                                                                                         name = “Swedland”
                                                                                         lat = 23410349
      length = 3 miles                                                                   long = 2342348852
                                 2

                          name = ...
Financial data – fraud detection
                                                                                name = ...

                                name = “The Tavern”
                                lat = 1295238237
                                long = 234823492                                                        42
name = “Mr Godfather”                                                                             AW
karma = veeeery-low
                                                                                            HDR
cash = more-than-you                                      amount = $1000
                                                                                          IT
                                                                                      W
                  OWNS                                    TRANSFER                        WIT
     1                                       7                              3                 HDR
                                                                                                  AW

                                                                                                           13

                                                 S FE R
                  DE                                             name = “Emil”
                     P   OS                                      cash = always-too-li'l
                           IT                TRAN
                                                                                                       title = “ATM @ Wall St”
                                                                                                       id = 230918484233
       amount = $1000                                                                                  cash_left = 384204
                                       2

                                name = ...
CDR analysis
                                                                               name = flat_business

                                     name = “Bob”
                                     lat = 1295238237
                                     long = 234823492                                             N    42
                                                                                                LA
name = “Mr Godfather”
karma = veeeery-low                                                                       _   P
cash = more-than-you                                     time = 2min                   TA
                                                                                     DA
                  CALLED                                  CALLED                         CAL
     1                                          7                          3                L   ED

                     CA
                                                                                                         13
                        L                                       name = “Emil”
                            LE
                                                     Y
                                 D                              cash = always-too-li'l
                                                FAMIL
                                                                                                      Name= customer_support

       time =13min
                                            2

                                     name = Alice
Call Data Records (CDR)
  Forming a graph
  Location based
  Possible uses:
    Find clusters (better plans)
    Build social connections
    Find influencers
Routing
Routing with Neo4j and A*
Routing
Connecting and Splitting


 Routing
Social graphs

 Recommendations
 Location based
 services
 Influencers
 Shortest path
Recommendations and big graphs
 Global heuristics
   Page rank
 Local recommendations
    Shortest paths
    Hammock functions
    Random walks
    Dijkstra, A*, Shooting star etc
Grammar based Random Walks




     Pic from gremlin.tinkerpop.com / Marko Rodriguez
Impact, Dependency Analysis
Master Data Management
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.
Current challenges in Spatial
  Domain and Spatial interconnections
  Unstructured domain data
  Routing
  Topology handling
  No good OSS full GIS stack
Multiple indexes - GIS
OpenStreetMap
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)
OpenStreetMap
OpenStreetMap
Web exposure of Spatial Data

 Davide Savazzi
 Geotools & GeoServer
 Routing
 uDig
GSoC 2010 - uDig
Neo4j dynamic layers

                         Geometry                     Layer1
                         Encoder
                          Dynamic
                           Query                      Layer2

                          Dynamic
                           Styles
                                                      Layer3
                          Dynamic
                          Meta-Inf


Connected domain data   Neo4j Spatial   GIS and Spatial stacks
OpenStreetMap




Dynamic                 OSM
 Laye rs




     Inde x (RTre e )
Dynamic Layers
Network Topology analysis

 Analytics of network coverage and frequencies
   Cell towers
   Drive data
   Infrastructure
 Analytics
   Spatial signal strength
   Antenna placement and azimuth
   Frequency planning
   Network differences over time
   Reporting and charting
Neo4j and Android
  Small footprint
  Running almost unmodified
  Interesting scenarios
     Semantic homescreen
     Connected devices
     Local caches
     Disconnected databases
Connected devices



                                 Emil

Emils PC
                                                             Marcus



                                         Leigh
                         Johan


  “Link all pictures that any of my friends has taken of me into
                      my PicturesOfMe folder and update this every hour”
Interesting scenarios
  Semantic homescreen
  Connected devices
  Local caches
  Disconnected databases
How ego are you? (aka other impls?)
  Franz’ Alle groGraph (http://agraph.franz.com)
     Proprietary, Lisp, RDF-oriented but real graphdb
  Sones graphDB        (http://sones.com)

     .NET, Deutsche Telekom VC backed
  Twitter's Floc kDB     (http://github.com/twitter/flockdb)

     Twitter's (graph) database for large and shallow graphs
  Google Pre ge l (http://bit.ly/dP9IP)
     We are oh-so-secret
  Objectivity's Infnite Graph (http://infinitegraph.com)
     New, closed OODB with Graph Layer on top
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/
Questions?




             Image credit: lost again! Sorry :(
http://neotechnology.com

More Related Content

More from Peter Neubauer

2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at Parisoma2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at ParisomaPeter Neubauer
 
2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to hero2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to heroPeter Neubauer
 
Test driven documentation
Test driven documentationTest driven documentation
Test driven documentationPeter Neubauer
 
Neo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouverNeo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouverPeter Neubauer
 
From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.Peter Neubauer
 
Tips for building communitites with limited resources
Tips for building communitites with limited resourcesTips for building communitites with limited resources
Tips for building communitites with limited resourcesPeter Neubauer
 
Intro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphsIntro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphsPeter Neubauer
 
Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.Peter Neubauer
 
Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!Peter Neubauer
 
GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.Peter Neubauer
 
Neo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtNeo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtPeter Neubauer
 

More from Peter Neubauer (13)

Intro to Neo4j 2.0
Intro to Neo4j 2.0Intro to Neo4j 2.0
Intro to Neo4j 2.0
 
2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at Parisoma2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at Parisoma
 
2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to hero2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to hero
 
Test driven documentation
Test driven documentationTest driven documentation
Test driven documentation
 
Neo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouverNeo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouver
 
From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.
 
Tips for building communitites with limited resources
Tips for building communitites with limited resourcesTips for building communitites with limited resources
Tips for building communitites with limited resources
 
Intro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphsIntro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphs
 
2011 11-öredev
2011 11-öredev2011 11-öredev
2011 11-öredev
 
Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.
 
Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!
 
GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.
 
Neo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtNeo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurt
 

Recently uploaded

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

2010 09-neo4j-deutsche-telekom

  • 1. Neo4j And TelCo goodness Some usecases #neo4j Peter Neubauer @peterneubauer peter@neotechnology.com Neo Technology
  • 2. NOSQL data models Key-value stores Data size Bigtable clones Document databases Graph databases Data complexity
  • 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. Agenda The NoSQL landscape Neo4j intro Examples for TelCos CDR Routing Social graphs Master Data Management Spatial and LBS Network topology analysis Neo4j and Android
  • 5. Neo4j? Most widely deployed graph db in the world ACID, persistent, embedded/server Robust: 24/7 production since 2003 Mature: lots of production deployments Scalable: High Availability, Master failover Community: ecosystem of tools, bindings, frameworks Product: OSGi, Spatial, RDF, languages Available under AGPLv3 and as commercial product But the f rst one is free! For ALL use-cases. i Links http://neo4j.org http://lists.neo4j.org
  • 6. Neo4j – Nodes, Relationships, Properties Nodes have different properties Matrix characters: People vs. Programs Build structure as you go Who loves Neo?
  • 7. 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
  • 8. 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();
  • 9. 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" ) ); }
  • 10. 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|...}
  • 11. Spatial and social data name = ... name = “The Tavern” lat = 1295238237 name = “Omni Hotel” long = 234823492 42 lat = 3492848 long = 283823423 length = 7 miles AD RO ROAD ROAD ROO 1 7 3 OAD RO 13 AD name = ... ROAD lat, long = ... name = “Swedland” lat = 23410349 length = 3 miles long = 2342348852 2 name = ...
  • 12. Financial data – fraud detection name = ... name = “The Tavern” lat = 1295238237 long = 234823492 42 name = “Mr Godfather” AW karma = veeeery-low HDR cash = more-than-you amount = $1000 IT W OWNS TRANSFER WIT 1 7 3 HDR AW 13 S FE R DE name = “Emil” P OS cash = always-too-li'l IT TRAN title = “ATM @ Wall St” id = 230918484233 amount = $1000 cash_left = 384204 2 name = ...
  • 13. CDR analysis name = flat_business name = “Bob” lat = 1295238237 long = 234823492 N 42 LA name = “Mr Godfather” karma = veeeery-low _ P cash = more-than-you time = 2min TA DA CALLED CALLED CAL 1 7 3 L ED CA 13 L name = “Emil” LE Y D cash = always-too-li'l FAMIL Name= customer_support time =13min 2 name = Alice
  • 14. Call Data Records (CDR) Forming a graph Location based Possible uses: Find clusters (better plans) Build social connections Find influencers
  • 19. Social graphs Recommendations Location based services Influencers Shortest path
  • 20. Recommendations and big graphs Global heuristics Page rank Local recommendations Shortest paths Hammock functions Random walks Dijkstra, A*, Shooting star etc
  • 21. Grammar based Random Walks Pic from gremlin.tinkerpop.com / Marko Rodriguez
  • 24. 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.
  • 25. Current challenges in Spatial Domain and Spatial interconnections Unstructured domain data Routing Topology handling No good OSS full GIS stack
  • 28. 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)
  • 31. Web exposure of Spatial Data Davide Savazzi Geotools & GeoServer Routing uDig
  • 32. GSoC 2010 - uDig
  • 33. Neo4j dynamic layers Geometry Layer1 Encoder Dynamic Query Layer2 Dynamic Styles Layer3 Dynamic Meta-Inf Connected domain data Neo4j Spatial GIS and Spatial stacks
  • 34. OpenStreetMap Dynamic OSM Laye rs Inde x (RTre e )
  • 36. Network Topology analysis Analytics of network coverage and frequencies Cell towers Drive data Infrastructure Analytics Spatial signal strength Antenna placement and azimuth Frequency planning Network differences over time Reporting and charting
  • 37. Neo4j and Android Small footprint Running almost unmodified Interesting scenarios Semantic homescreen Connected devices Local caches Disconnected databases
  • 38. Connected devices Emil Emils PC Marcus Leigh Johan “Link all pictures that any of my friends has taken of me into my PicturesOfMe folder and update this every hour”
  • 39. Interesting scenarios Semantic homescreen Connected devices Local caches Disconnected databases
  • 40. How ego are you? (aka other impls?) Franz’ Alle groGraph (http://agraph.franz.com) Proprietary, Lisp, RDF-oriented but real graphdb Sones graphDB (http://sones.com) .NET, Deutsche Telekom VC backed Twitter's Floc kDB (http://github.com/twitter/flockdb) Twitter's (graph) database for large and shallow graphs Google Pre ge l (http://bit.ly/dP9IP) We are oh-so-secret Objectivity's Infnite Graph (http://infinitegraph.com) New, closed OODB with Graph Layer on top
  • 41. 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/
  • 42. Questions? Image credit: lost again! Sorry :(