简体   繁体   中英

How does neo4j perform in time and space complexity for given type of nodes, relationships and queries?

Consider I'm going to have following things in my graph:

100 Million nodes, More than 1 Billion connections/relationships

Node properties: around 10 properties, mix of int, doubles, strings, HashMaps etc.

Relationship properties: around 10 double values and 2-3 string (with avg 50 chars) values

Now, Suppose I want to update all node and relationship property values, by querying neighbors on each node once. ie say as,

step1: search a node, say X, with given Id,
step2: get it's neighbours,
step3: update node properties of X and all relationship properties between X and it's neighbors.

Repeat these 3 steps for all nodes once. How much time will it take for once update of all nodes(approx time is OK for me, may be in seconds / minutes / hrs) given following system configuration:

Two dual core processors, 3.0 GHz each, 4*4 GB memory, 250 GB Hard disk space.

How much approximate storage space will be required for above mentioned data?

Please help me by providing any approximate, sample performance (time and storage) analysis. Any sample performance analysis will help me to visualize my requirements. Thanks.

Size consideration is pretty easy for node/relationships. Each node is 9 Bytes, and each relationship is 33 Bytes.

9B x 100M = 900 Million Bytes =~ 858.3 Megabytes for nodes
33B x 1B = 33 Billion bytes =~ 30.7 Gigabytes for relationships

As for the computation, it's tough to gauge that. Neo4j cache isn't 1-to-1 with what is on disk, so your storage may be ~31Gb, but you'll need much more then that to store it in cache. The way neo4j stores the information on disk is efficient for this type of traversal though, as they store all relationships and properties for a node in a linked list, so accessing them through an iterator is more effient then searching for one type of relationship.

It would be hard to give you an estimate, but I'd say since you are going through duplicate relationships, what can fit on RAM vs Disk, etc. My guess would be a few hours(<6Hrs.) given your system and size requirements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM