In one of our databases, we distinguished between transactional
and dictionary
records.
In a couple of words, transactional
records are things that you cannot roll back in real life, like a call from a customer. You can change the caller's name, status etc., but you cannot dismiss the call itself.
Dictionary
records are things that you can change, like assigning a city
to a customer.
Transactional
records and things that lead to them were never deleted, while dictionary
ones could be deleted all right.
By "things that lead to them" I mean that as soon as the record appears in the business rules which can lead to a transactional
record, this record also becomes transactional
.
Like, a city
can be deleted from the database. But when a rule appeared that said "send an SMS
to all customers in Moscow", the cities became transactional
records as well, or we would not be able to answer the question "why did this SMS
get sent".
A rule of thumb for distinguishing was this: is it only my company's business?
If one of my employees made a decision based on data from the database (like, he made a report based on which some management decision was made, and then the data report was based on disappeared), it was considered OK to delete these data.
But if the decision affected some immediate actions with customers (like calling, messing with the customer's balance etc.), everything that lead to these decisions was kept forever.
It may vary from one business model to another: sometimes, it may be required to record even internal data, sometimes it's OK to delete data that affects outside world.
But for our business model, the rule from above worked fine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…