neo4j - "snapshot" of nodes at time of transaction -


i have scenario have few products sold during event. these products configured once , can used @ event. have following nodes/relationships:

event-[:has_current_inventory]->inventory-[:of_product]->product 

the inventory here single product, have number of these each event. when transaction occurs, want maintain snapshot of inventory across products sell @ event. thinking of doing way:

  • create new transaction node
  • create new "inventory" nodes of inventory items included in transaction new inventory count
  • link new transaction node "current" inventory nodes (not ones in transaction, of them)
  • replace "has_current_inventory" relationship inventory nodes affected, , give them "archived" relationship. simultaneously, create "has_current_inventory" links new inventory nodes.

is there more optimal way implement this? important have snapshot of inventory levels across event when single transaction occurred, or @ arbitrary point in time. however, creating tonne of stuff each transaction @ event. there better way query info?


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -