Django and Neo4j Domain modeling that kicks ass! twitter: @thobe / - - PowerPoint PPT Presentation

django and neo4j
SMART_READER_LITE
LIVE PREVIEW

Django and Neo4j Domain modeling that kicks ass! twitter: @thobe / - - PowerPoint PPT Presentation

Django and Neo4j Domain modeling that kicks ass! twitter: @thobe / #neo4j Tobias Ivarsson email: tobias@neotechnology.com web: http://www.neo4j.org/ Hacker @ Neo Technology web: http://www.thobe.org/ It all started with this guy. Emil


slide-1
SLIDE 1

Django and Neo4j

Domain modeling that kicks ass!

Tobias Ivarsson

Hacker @ Neo Technology

twitter: @thobe / #neo4j email: tobias@neotechnology.com web: http://www.neo4j.org/ web: http://www.thobe.org/

slide-2
SLIDE 2

2 It all started with this guy. Emil Eifrem, CEO of Neo

  • Technology. We picked him

apart, and inside his brain we found the base for a database that models the connections in between entities.

slide-3
SLIDE 3

2 Image credits: US Army It all started with this guy. Emil Eifrem, CEO of Neo

  • Technology. We picked him

apart, and inside his brain we found the base for a database that models the connections in between entities.

slide-4
SLIDE 4

2 It all started with this guy. Emil Eifrem, CEO of Neo

  • Technology. We picked him

apart, and inside his brain we found the base for a database that models the connections in between entities.

slide-5
SLIDE 5

2

Neo4j

It all started with this guy. Emil Eifrem, CEO of Neo

  • Technology. We picked him

apart, and inside his brain we found the base for a database that models the connections in between entities.

slide-6
SLIDE 6

NOSQL is a wide area

3

slide-7
SLIDE 7

The problems NOSQL focuses on

4

Data complexity Performance

Majority of Webapps Semantic Trading Salary List Social network

}

custom

Relational database Requirement of application

Focus area of many NOSQL Databases

๏ Huge amounts of data ๏ (mostly) Disjoint data ๏ Heavy load ๏ Many concurrent writers

All NOSQL databases focus

  • n solving problems where

RDBMSes fail. most focus on... While this handles the load, it lacks in “ social”

slide-8
SLIDE 8

The evolution of data

5

Text documents

1990 Information connectivity

Folksonomies Tagging User-generated content Wikis RSS Blogs Hypertext

2000 2010 2020

web 1.0 web 2.0 “web 3.0”

Ontologies RDF Giant Global Graph (GGG)

... but it turns out that data evolves to become MORE interconnected (as well as greater sizes)

slide-9
SLIDE 9

Neo4j is a Graph Database

6 Graph databases FOCUS

  • n the interconnection

between entities.

slide-10
SLIDE 10

6

IS_A

Neo4j Graph Database

Graph databases FOCUS

  • n the interconnection

between entities.

slide-11
SLIDE 11

Scaling to size vs. Scaling to complexity

7

Size Complexity

Key/Value stores Bigtable clones Document databases Graph databases

slide-12
SLIDE 12

Scaling to size vs. Scaling to complexity

7

Size Complexity

Key/Value stores Bigtable clones Document databases Graph databases

> 90% of use cases

Billions of nodes and relationships

slide-13
SLIDE 13

What is Neo4j?

๏Neo4j is a Graph Database

  • Non-relational (“#nosql”), transactional (ACID), embedded
  • Data is stored as a Graph / Network
  • Nodes and relationships with properties
  • “Property Graph” or “edge-labeled multidigraph”
  • Schema free, bottom-up data model design

๏Neo4j is Open Source / Free (as in speech) Software

  • AGPLv3
  • Commercial (“dual license”) license available
  • First server is free (as in beer), next is inexpensive

8

Prices are available at http:/ /neotechnology.com/ Contact us if you have questions and/or special license needs (e.g. if you want an evaluation license)

slide-14
SLIDE 14

More about Neo4j

๏Neo4j is stable

  • In 24/7 operation since 2003

๏Neo4j is in active development

  • Neo Technology received

VC funding October 2009

๏Neo4j delivers high performance graph operations

  • traverses 1’000’000+ relationships / second
  • n commodity hardware

(1000~2500 traversals/ms)

9

slide-15
SLIDE 15

Building business applications with Neo4j

๏Try it out! It’s all open source!

  • Build a prototype, find out your needs and how Neo4j matches
  • AGPL says all your users should have access to your code
  • at this stage this is your employees / co-workers

10

slide-16
SLIDE 16

Building business applications with Neo4j

๏Try it out! It’s all open source!

  • Build a prototype, find out your needs and how Neo4j matches
  • AGPL says all your users should have access to your code
  • at this stage this is your employees / co-workers

๏Put it in front of users! The license is free for the first server!

  • Contact Neo Technology sales to get a free single server license
  • You’ll (probably) not have massive load the first days

10

slide-17
SLIDE 17

Building business applications with Neo4j

๏Try it out! It’s all open source!

  • Build a prototype, find out your needs and how Neo4j matches
  • AGPL says all your users should have access to your code
  • at this stage this is your employees / co-workers

๏Put it in front of users! The license is free for the first server!

  • Contact Neo Technology sales to get a free single server license
  • You’ll (probably) not have massive load the first days

๏As you grow, Neo4j grows with you!

  • As your needs and revenue increase you can by an advanced

license (prices are resonable)

10

slide-18
SLIDE 18

Graphs are all around us

A B C D ... 1 2 3 4 5 ... 17 3.14 3 17.79333333333 42 10.11 14

30.33

316 6.66 1

2104.56

32 9.11 592 0.492432432432

2153.175765766

11

Even if this spreadsheet looks like it could be a fit for a RDBMS it isn’t:

  • RDBMSes have problems with

extending indefinitely on both rows and columns

  • Formulas and data

dependencies would quickly lead to heavy join operations

slide-19
SLIDE 19

Graphs are all around us

12 With data dependencies the spread sheet turns

  • ut to be a graph.

A B C D ... 1 2 3 4 5 ... 17 3.14 3

= A1 * B1 / C1

42 10.11 14

= A2 * B2 / C2

316 6.66 1

= A3 * B3 / C3

32 9.11 592

= A4 * B4 / C4 = SUM(D2:D5)

slide-20
SLIDE 20

Graphs are all around us

12 With data dependencies the spread sheet turns

  • ut to be a graph.

A B C D ... 1 2 3 4 5 ... 17 3.14 3

= A1 * B1 / C1

42 10.11 14

= A2 * B2 / C2

316 6.66 1

= A3 * B3 / C3

32 9.11 592

= A4 * B4 / C4 = SUM(D2:D5)

slide-21
SLIDE 21

Graphs are all around us

13

If we add external data sources the problem becomes even more interesting...

17 3.14 3

= A1 * B1 / C1

42 10.11 14

= A2 * B2 / C2

316 6.66 1

= A3 * B3 / C3

32 9.11 592

= A4 * B4 / C4 = SUM(D2:D5)

slide-22
SLIDE 22

Graphs are all around us

13

If we add external data sources the problem becomes even more interesting...

17 3.14 3

= A1 * B1 / C1

42 10.11 14

= A2 * B2 / C2

316 6.66 1

= A3 * B3 / C3

32 9.11 592

= A4 * B4 / C4 = SUM(D2:D5)

slide-23
SLIDE 23

The Neo4j Graph data model

14

  • Nodes
  • Relationships between Nodes
  • Relationships have Labels
  • Relationships are directed, but traversed at

equal speed in both directions

  • The semantics of the direction is up to the

application (LIVES WITH is reflexive, LOVES is not)

  • Nodes have key-value properties
  • Relationships have key-value properties
slide-24
SLIDE 24

The Neo4j Graph data model

14

  • Nodes
  • Relationships between Nodes
  • Relationships have Labels
  • Relationships are directed, but traversed at

equal speed in both directions

  • The semantics of the direction is up to the

application (LIVES WITH is reflexive, LOVES is not)

  • Nodes have key-value properties
  • Relationships have key-value properties
slide-25
SLIDE 25

The Neo4j Graph data model

14

LIVES WITH LOVES OWNS DRIVES

  • Nodes
  • Relationships between Nodes
  • Relationships have Labels
  • Relationships are directed, but traversed at

equal speed in both directions

  • The semantics of the direction is up to the

application (LIVES WITH is reflexive, LOVES is not)

  • Nodes have key-value properties
  • Relationships have key-value properties
slide-26
SLIDE 26

The Neo4j Graph data model

14

LIVES WITH LOVES OWNS DRIVES LOVES

  • Nodes
  • Relationships between Nodes
  • Relationships have Labels
  • Relationships are directed, but traversed at

equal speed in both directions

  • The semantics of the direction is up to the

application (LIVES WITH is reflexive, LOVES is not)

  • Nodes have key-value properties
  • Relationships have key-value properties
slide-27
SLIDE 27

The Neo4j Graph data model

14

LIVES WITH LOVES OWNS DRIVES LOVES name: “James” age: 32 twitter: “@spam” name: “Mary” age: 35 brand: “Volvo” model: “V70”

  • Nodes
  • Relationships between Nodes
  • Relationships have Labels
  • Relationships are directed, but traversed at

equal speed in both directions

  • The semantics of the direction is up to the

application (LIVES WITH is reflexive, LOVES is not)

  • Nodes have key-value properties
  • Relationships have key-value properties
slide-28
SLIDE 28

The Neo4j Graph data model

14

LIVES WITH LOVES OWNS DRIVES LOVES name: “James” age: 32 twitter: “@spam” name: “Mary” age: 35 brand: “Volvo” model: “V70” item type: “car”

  • Nodes
  • Relationships between Nodes
  • Relationships have Labels
  • Relationships are directed, but traversed at

equal speed in both directions

  • The semantics of the direction is up to the

application (LIVES WITH is reflexive, LOVES is not)

  • Nodes have key-value properties
  • Relationships have key-value properties
slide-29
SLIDE 29

Graphs are Whiteboard Friendly

15 The domain I specify is the domain I implement. No mismatch, no ER

  • modeling.
slide-30
SLIDE 30

Graphs are Whiteboard Friendly

15

thobe Wardrobe Strength dude Hello world OSCON #6 #14 #32 #17 Joe project

  • din

Call site caching Optimizing Jython Best panncakes

The domain I specify is the domain I implement. No mismatch, no ER

  • modeling.
slide-31
SLIDE 31

Graphs are Whiteboard Friendly

16

Wardrobe Strength dude Hello world OSCON #6 #14 #32 #17 Joe project

  • din

Call site caching Optimizing Jython Best panncakes

username: “thobe” name: “Tobias Ivarsson” twitter: “@thobe” password: “**********”

slide-32
SLIDE 32

Graphs are Whiteboard Friendly

17

thobe dude Hello world OSCON #6 #14 #32 #17 Joe project

  • din

Call site caching Optimizing Jython Best panncakes

address: “http://journal.thobe.org” title: “Wardrobe Strength” tagline: “Good enough thoughts”

slide-33
SLIDE 33

Building a graph - the basic API

import neo4j grapDb = neo4j.GraphDatabase( PATH_TO_YOUR_NEO4J_DATASTORE ) with graphDb.transaction: # All writes require transactions # Create Thomas 'Neo' Anderson mrAnderson = graphDb.node(name="Thomas Anderson", age=29) # Create Morpheus morpheus = graphDb.node(name="Morpheus", rank= "Captain",

  • ccupation= "Total bad ass")

# Create relationship representing they know each other mrAnderson.KNOWS( morpheus ) # ... similarly for Trinity, Cypher, Agent Smith, Architect

18

slide-34
SLIDE 34

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

19 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public”

slide-35
SLIDE 35

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public”

slide-36
SLIDE 36

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public”

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-37
SLIDE 37

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public”

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-38
SLIDE 38

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public” Morpheus (@ depth=1)

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-39
SLIDE 39

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public” Morpheus (@ depth=1) Trinity (@ depth=1)

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-40
SLIDE 40

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public” Morpheus (@ depth=1) Trinity (@ depth=1) Cypher (@ depth=2)

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-41
SLIDE 41

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public” Morpheus (@ depth=1) Trinity (@ depth=1) Cypher (@ depth=2) Agent Smith (@ depth=3)

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-42
SLIDE 42

since: “meeting the oracle” since: “a year before the movie” cooperates on: “The Nebuchadnezzar”

Graph traversals

import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ]

  • rder = neo4j.BREADTH_FIRST

stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE

20 name: “Thomas Anderson” age: 29 name: “Morpheus” rank: “Captain”

  • ccupation: “Total badass”

name: “Trinity” name: “Cypher” last name: “Reagan” name: “Agent Smith” version: “1.0b” language: “C++” name: “The Architect” KNOWS KNOWS KNOWS KNOWS KNOWS CODED BY LOVES disclosure: “secret” disclosure: “public” Morpheus (@ depth=1) Trinity (@ depth=1) Cypher (@ depth=2) Agent Smith (@ depth=3)

for friend_node in Friends(mr_anderson): print "%s (@ depth=%s)" % ( friend_node["name"], friend_node.depth )

slide-43
SLIDE 43

Finding a place to start

๏Traversals need a Node to start from

  • QUESTION: How do I find the start Node?
  • ANSWER:

You use an Index

๏Indexes in Neo4j are different from Indexes in Relational Databases

  • RDBMSes use them for Joining
  • Neo4j use them for simple lookup

21

index = graphDb.index["name"] mr_anderson = index["Thomas Anderson"] performTraversalFrom( mrAnderson )

slide-44
SLIDE 44

Indexes in Neo4j

๏The Graph *is* the main index

  • Use relationship labels for navigation
  • Build index structures *in the graph*
  • Search trees, tag clouds, geospatial indexes, et.c.
  • Linked/skip lists or other data structures in the graph
  • We have utility libraries for this

๏External indexes used *for lookup*

  • Finding a (number of) points to start traversals from
  • Major difference from RDBMS that use indexes for everything

22

slide-45
SLIDE 45

Django integration does all of this for you!

23

slide-46
SLIDE 46

Implementing the domain

24

user blog entry comment

slide-47
SLIDE 47

from neo4j.model import django_model as models

25

blog entry comment user

slide-48
SLIDE 48

from neo4j.model import django_model as models

25

blog entry comment

class User(models.NodeModel): username = models.Property(indexed=True) name = models.Property() blogs = models.Relationship(Blog, type=models.Outgoing.member_of, related_name="users") def __unicode__(self): return self.name

slide-49
SLIDE 49

from neo4j.model import django_model as models

26

user entry comment

class Blog(models.NodeModel): identifier = models.Property(indexed=True) title = models.Property() def __unicode__(self): return self.title

slide-50
SLIDE 50

from neo4j.model import django_model as models

27

user blog comment

class Entry(models.NodeModel): title = models.Property() text = models.Property() date = models.Property() blog = models.Relationship(Blog, type=models.Outgoing.posted_on, single=True, optional=False, related_name="articles") author = models.Relationship(User, type=models.Outgoing.authored_by, single=True, optional=False, related_name="articles")

slide-51
SLIDE 51

from neo4j.model import django_model as models

models.py

class Blog(models.NodeModel): identifier = models.Property(indexed=True) title = models.Property() class User(models.NodeModel): username = models.Property(indexed=True) name = models.Property() blogs = models.Relationship(Blog, type=models.Outgoing.member_of, related_name="users") class Entry(models.NodeModel): title = models.Property() text = models.Property() date = models.Property() blog = models.Relationship(Blog, type=models.Outgoing.posted_on, single=True, optional=False, related_name="articles") author = models.Relationship(User, type=models.Outgoing.authored_by, single=True, optional=False, related_name="articles")

28 The rest of the code for working with the domain

  • bjects is (mostly) the same

as you are used to in Django.

slide-52
SLIDE 52

Why not use an O/R mapper?

๏Model evolution in ORMs is a hard problem

  • virtually unsupported in most ORM systems

๏SQL is “compatible” across many RDBMSs

  • data is still locked in

๏Each ORM maps object models differently

  • Moving to another ORM == legacy schema support
  • except your legacy schema is a strange auto-generated one

๏Object/Graph Mapping is always done the same way

  • allows you to keep your data through application changes
  • or share data between multiple implementations

29

slide-53
SLIDE 53

What an ORM doesn’t do

๏Deep traversals ๏Graph algorithms ๏Shortest path(s) ๏Routing ๏etc.

30

slide-54
SLIDE 54

Path exists in social network

๏Each person has on average 50 friends

31

Database # persons query time Relational database Neo4j Graph Database 1 000 2 000 ms 1 000 2 ms

Tobias Emil Johan Peter The performance impact in Neo4j depends only on the degree of each node. in an RDBMS it depends on the number of entries in the tables involved in the join(s).

slide-55
SLIDE 55

Path exists in social network

๏Each person has on average 50 friends

31

Database # persons query time Relational database Neo4j Graph Database Neo4j Graph Database Relational database 1 000 2 000 ms 1 000 2 ms 1 000 000 2 ms 1 000 000 way too long...

Tobias Emil Johan Peter The performance impact in Neo4j depends only on the degree of each node. in an RDBMS it depends on the number of entries in the tables involved in the join(s).

slide-56
SLIDE 56

๏20 million Nodes - represents places ๏62 million Edges - represents direct roads between places

  • These edges have a length property, for the length of the road

๏Average optimal route, 100 separate roads, found in 100ms ๏Worst case route we could find:

  • Optimal route is 5500 separate roads
  • Total length ~770km
  • Found in less than 3 seconds

๏Uses A* “best first” search

On-line real time routing with Neo4j

32 There’s a difference between least number of hops and least cost.

slide-57
SLIDE 57

Jython vs. CPython

๏Neo4j with the Python bindings work in both

  • Requires no code modification in your code

๏Neo4j at its core is an Embedded (in-process) database

  • CPython manages concurrency by forking multiple processes
  • Jython has full concurrency support in the same JVM
  • Stand-alone Neo4j server-process with (C)Python client

is being worked on

๏Neo4j has a RESTful interface

  • There are Python clients
  • The API differs slightly (no transactions)

33

slide-58
SLIDE 58

Finding out more

34

๏http://neo4j.org/ - project website - main place for getting started

  • Contains screen casts, download links, et.c.
  • http://api.neo4j.org/ and http://components.neo4j.org/
  • Specifically http://components.neo4j.org/neo4j.py/
  • http://wiki.neo4j.org/ - HowTos, Tutorials, Examples, FAQ, et.c.
  • http://planet.neo4j.org/ - aggregation of blogs about Neo4j
  • http://github.com/neo4j-examples - small example applications

๏https://lists.neo4j.org/ - community mailing list ๏http://twitter.com/neo4j/team - follow the Neo4j team ๏http://neotechnology.com/ - commercial licensing

slide-59
SLIDE 59

Helping out!

๏Neo4j and the Python integration is all Open Source ๏The Python bindings in particular would benefit from more devs...

  • Integrate more of the Neo4j components
  • Neo4j Spatial
  • The Graph Algorithms package
  • The Graph Matching component
  • Trimming off the rough edges in the Django integration
  • Native client for CPython

35

slide-60
SLIDE 60

Buzzword summary

36

AGPLv3 ACID transactions Embedded NOSQL

Beer

A* routing Open Source Free Software http://neo4j.org/ Software Transactional Memory whiteboard friendly Object mapping Traversal Query language SPARQL Scaling to complexity Shortest path Semi structured Schema free Polyglot persistence RESTful Gremlin