Database enforced timestamps, immutable columns, and counter/sum caches