Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Adopting Neo4j @ Enterprise scale

Adopting Neo4j @ Enterprise scale

Dmitrijs Vrublevskis

October 14, 2016
Tweet

More Decks by Dmitrijs Vrublevskis

Other Decks in Programming

Transcript

  1. Why Neo4j? Highly scalable native graph database that leverages data

    relationships as 
 first-class entities. by Neo Technology, Inc.
  2. Features Native Processing & Storage ACID Cypher - Graph Query

    Language REST & Native API Optional schema Lock Manager High-performance cache Clustering Backups Monitoring Community Enterprise
  3. Native processing Efficient way of processing graph data since connected

    nodes physically “point” to each other a.k.a. “index-free adjacency”
  4. $ ls -1 data/databases/graph.db | column -c 100 index neostore.propertystore.db.index.id

    index.db neostore.propertystore.db.index.keys messages.log neostore.propertystore.db.index.keys.id neostore neostore.propertystore.db.strings neostore.counts.db.a neostore.propertystore.db.strings.id neostore.counts.db.b neostore.relationshipgroupstore.db neostore.id neostore.relationshipgroupstore.db.id neostore.labeltokenstore.db neostore.relationshipstore.db neostore.labeltokenstore.db.id neostore.relationshipstore.db.id neostore.labeltokenstore.db.names neostore.relationshiptypestore.db neostore.labeltokenstore.db.names.id neostore.relationshiptypestore.db.id neostore.nodestore.db neostore.relationshiptypestore.db.names neostore.nodestore.db.id neostore.relationshiptypestore.db.names.id neostore.nodestore.db.labels neostore.schemastore.db neostore.nodestore.db.labels.id neostore.schemastore.db.id neostore.propertystore.db neostore.transaction.db.0 neostore.propertystore.db.arrays neostore.transaction.db.1 neostore.propertystore.db.arrays.id schema neostore.propertystore.db.id store_lock neostore.propertystore.db.index
  5. $ ls -1 data/databases/graph.db | column -c 100 index neostore.propertystore.db.index.id

    index.db neostore.propertystore.db.index.keys messages.log neostore.propertystore.db.index.keys.id neostore neostore.propertystore.db.strings neostore.counts.db.a neostore.propertystore.db.strings.id neostore.counts.db.b neostore.relationshipgroupstore.db neostore.id neostore.relationshipgroupstore.db.id neostore.labeltokenstore.db neostore.relationshipstore.db neostore.labeltokenstore.db.id neostore.relationshipstore.db.id neostore.labeltokenstore.db.names neostore.relationshiptypestore.db neostore.labeltokenstore.db.names.id neostore.relationshiptypestore.db.id neostore.nodestore.db neostore.relationshiptypestore.db.names neostore.nodestore.db.id neostore.relationshiptypestore.db.names.id neostore.nodestore.db.labels neostore.schemastore.db neostore.nodestore.db.labels.id neostore.schemastore.db.id neostore.propertystore.db neostore.transaction.db.0 neostore.propertystore.db.arrays neostore.transaction.db.1 neostore.propertystore.db.arrays.id schema neostore.propertystore.db.id store_lock neostore.propertystore.db.index
  6. Storage layout Node (15 bytes) in_use next_rel_id next_prop_id labels extra

    Relationship (34 bytes) directed | in_use first_node second_node rel_type first_prev_rel_id first_next_rel_id second_prev_rel_id second_next_rel_id next_prop_id first_in_chain_markers
  7. Storage layout Node (15 bytes) next_rel_id Relationship (34 bytes) first_node

    second_node first_prev_rel_id first_next_rel_id
  8. Traversal (Relationship -> Node) Relationship (34 bytes) Nodes (15 bytes)

    0B 15B 30B 45B 60B 75B first_node=1 second_node=4 1 * 15 = 15 4 * 15 = 60
  9. Cypher Cypher is a declarative graph query language that allows

    for expressive and efficient querying. https://github.com/opencypher/openCypher
  10. Cypher 101 ASCII art: ( ) - node --> -

    relationship Keywords: MATCH CREATE WHERE RETURN
  11. UC: Sync Before Neo4j ~90m ~35m Count Per second Node

    count 80.32M 37498 Relationship count 80.30M 37488 Properties count 257.78M 120345
  12. 3 4 5 6 8 2 7 1 UC: Traversal

    Before Neo4j 112ms 39ms MATCH (n)-[r]->(c)
 WHERE n.id = {id} RETURN *
  13. Deployment • Implemented in Java • Works everywhere • Writes

    - vertical scaling • Reads - horizontal scaling • Extensions & Stored procedures
  14. Stability • High load on DB • Kill Slave/master •

    Rolling upgrade • Split-brain • Server power-off