I'm looking for patterns (ideally with advantages/disadvantages) that can be used for databases concerning time.
One I can think of is to have a node representing a point in time or time period.
What others are there? What others have you used?
Neo4j uses a property graph database model. A graph data structure consists of nodes (discrete objects) that can be connected by relationships. Example 1.
Neo4j is a native graph database, which means that it implements a true graph model all the way down to the storage level. The data isn't stored as a "graph abstraction" on top of another technology, it's stored just as you whiteboard it.
A graph database will always have a rudimentary schema consisting of (at least) Vertex and Edge objects, where an Edge can contain data about a particular relationship. The degree to which you can add to this schema varies widely across implementations.
This question is very open-ended, and SO is meant for questions with specific technical answers.
TL;DR: Graph patterns are infinite. Start from the problem, not the possibilities.
There isn't a set of temporal graph patterns, and even if there was, each pattern would be unique for a specific use-case, and close to useless elsewhere. What you should be asking yourself:
Modelling information flow in a datacenter's network? Probably only need seconds and microseconds in a property on the relevant data.
Modelling evolution on the tree of life? Probably don't need anything from Time or even Date, instead using a float and an int for exponential notation, or a single int representing thousands of years.
The three most common patterns I've seen (because they're the most flexible and easiest to work with in queries):
(cause)-->(event {datetime})
(event)-->(datetime)
and (datetime)-[:NEXT]->(datetime)-[:NEXT]->(datetime)
However, even with these patterns there are still many open-ended questions. Consider a case of tracking modifications to files...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With