Period

A business needs to track periods of time. This is a special case of the Range pattern, where the data values are date and time related.

A period can be constructed with a single boundary and an interval. As most actions with periods rely on testing its boundaries, this approach would need continuous calculation of the opposite boundary. Conversely, the interval can always be calculated from the two period boundaries and is used less often.

Continue reading

Range

A business needs to bucket sets of consecutive, ordinal, data for aggregation purposes like age group, salary band, period, life cycle phase, and so on. This is different from grouping non-consecutive, nominal, data into buckets, such as hierarchies.

You need to store a complete definition of all buckets and the values they contain, while allowing for minimum and maximum values and gaps between buckets. Bucket boundaries can change regularly, while the precision and scale of boundaries changes at a slower rate.
Continue reading