Best practices

what are few best practices to keep in mind?

  1. Are there recommendations around if frequently updated data should or shouldn’t be placed in graph?
  2. Are there metrics on performance of gql based on number of Nodes and attributes?

Hi @kool.hetal and welcome to the Neo4j community!

Best practices is a broad topic. You've started with two great questions which are worth exploring before we expand. I'll start with the first one...

1) Recommendations for frequently updated data

Frequently updated data can be considered in terms of the "blast radius" of the change, meaning how much is impacted when a change is made. Here's an unscientific list in increasing order of cost:

  1. small primitive values (not indexed): Integer, Float, (small) String, Boolean, Point, Date, Time, LocalTime, DateTime, LocalDateTime, and Duration
  2. large primitive values (not indexed): arrays of primitive values and large Strings
  3. small primitive values (indexed)
  4. large primitive values (indexed)
  5. node labels (which are always indexed)
  6. node create/delete (without relationships)
  7. relationship create/delete
  8. node create/delete (with relationships): the cost will go up with each relationship

The best practice for frequently updated data would be to use the least expensive change operation.

Two approaches for accumulating data without deleting it could be included:

  1. a chain of nodes+rels
  2. a set of self-relationships to a base node

You've inspired me to write some tests to validate this list. I'll give each of those a try and report back here. :slight_smile:


1 Like

Appreciate your response! Looking forward to hear more from you on both points