Wednesday, 28 November 2012

Neo4J meetup

Yesterday, I attended a Neo4J meetup at OpenCredo. This post is rather a reminder for myself than a proper article.

Neo4j - Graph database for Java

@OpenCredo - http://www.opencredo.com
Speakers: Rik Van Brugen (rik (at) neotechnology (dot) com) and Aleksa Vukotic

The bottleneck of the SQL databases: Big Data, complexity (normalisation -> joins -> performance)

The NoSQL databases answers are

  • denormalisation, aggregation (addressing the performance issuse) - document store, key-value stores, column field stores
  • richer model, connected structure (addressing the complexity issue) - graph databases

Definition of complexity:

complexity = f(size, semiStructure, connectedness)
  • size - the size of the data
  • semiStructure - the world has to be modelled and normalized/denormalized
  • connectedness - how densly linked the data (map.linkedin.com)

Neo4j for densly connected, semi-structured domains

Properties of Neo4J

  • ACID compatiblity
  • Property Graph model
    • both the nodes and relationships can have properties.
    • the relationships are directed
    • bi-directed = two directed relationship
    • no schema at all - no forced properties
    • main attribute ???
    • arbitrary properties - serializable ??
    • indexes - used once a query - look up the ancher where the query starts from.
  • Built in web console
  • Compatibility with several visualisation tools
Performance
  • number of hops - 2m/sec on an old desk.
  • reading property is slow
  • rather dependent on resultSet than inputSet... no table filtering.
  • different caching/memory managements
  • localized information - not for global analytical information
Security
  • no access to everything, because a node has access only to the neighbours
  • No ACL over the nodes
  • ACL can be created over subgraphs.

Query language

There is possibility to use direct Java API to query the graph, but the Cypher is new and nice.

There are two types of queries: local and global queries.

Local queries:
  • Online, real-time operations
  • Normal way:
    1. Grab a node and query from the anchor.
    2. pattern maching - match the patter against the grabbed node(s).
  • Support for graph algorithms: shortest path queries, etc.
Global queries:
  • Analytical slow queries, usually too slow for online/real-time use
  • Calculate the entire space - global calculation
Cypher (ASCII art language :) )
There were a couple of examples.

Showcases

Neo4J in action

  • Opigram - Opinion site - the users can express their opinion about almost anything.
  • TelCo example
Others

Thanks you guys, it was really useful.

No comments:

Post a Comment