Time entities and buckets

A time entity represents the moment an event happens, such as a reading from a sensor or a price quote. It must contain only identifier attributes and must participate with minimum cardinality 1. Only one entity in a relationship can be the time entity.

In the translation stage, a relationship with a time entity is translated with the bucket pattern: one document per owner and time window, with an array of events inside. The time entity does not become its own collection; its timestamp is stored on each event.

A bucket can be closed by one of two criteria. The Bucket tutor asks whether data arrives at regular intervals or irregularly and suggests the matching one:

CriterionChoose it whenAdvantagesDrawbacks
Time interval (month, day, hour, minute)Data arrives at regular intervalsPredictable bucket size; efficient time-range queriesSparse buckets if events slow down; uneven fill level across buckets
Maximum number of events (50 to 5000)Data is captured irregularlyBounded document size; no sparse bucketsBuckets span unpredictable time ranges; time-range queries scan more buckets