Skip to main content

Monotonically increasing

Monotonicity means unchanging (think monotone). A monotonically-increasing value is a value which increases at a constant rate, for example the values [1, 2, 3, 4].

Monotonically-increasing values often appear in primary keys generated by production systems. In an analytics engineering context, you should avoid generating such values or assuming their existence in your models, because they make it more difficult to create an idempotent data model. Instead you should create a surrogate key which is derived from the unique component(s) of a row.