Which variables to materialise?

Which variables are materialised?

The base/derived distinction is all about how constraints are imposed. It it not about which variables are materialised.

There are many cases where a bijection can be defined between a set of base variables and a set of derived variables, where the base variables are unconstrained, whereas the derived variables are constrained. In that case it is typically appropriate to physically materialise the derived variables, instead of the base variables. In effect the injective functions are cached so it's efficient when there's a high ratio of readers to writers. There isn't a space overhead if the base variables aren't materialised. Nevertheless writers express updates against the base variables, and Operational Transformation is defined on operations on the base variables.

Read caches

The question of whether to cache what is read, or calculate it as needed is an important one. When a view is defined declaratively - i.e. in terms of functions of the base variables, then it may be necessary to also specify which derived variables are cached.

However, whether or not derived variables are cached or calculated on demand can be hidden from the readers that access the view - i.e the way the data is accessed is the same. This is an important requirement of logical independence.