Data Mutation Is Data Loss

Let's illustrate what we mean by this with an example:

Example

Let's say you are modeling a Shopping Cart.

If you model the shopping card as a typical CRUD data base, let's say in DynamoDB you could end up with a Hash key holding Customers Cart ID and the Range Key holding the ID of items that have been added. You cart represents the current snapshot in time.

Now we have a scenario customer with Cart-I:

  • Customer adds ItemA.
    • DB holds data Cart-I:[ItemA]
  • Customer adds ItemB.
    • DB holds data Cart-I:[ItemA, ItemB]
  • Customer removes ItemA.
    • DB holds data Cart-I:[ItemB]

You Database now looks like:

Cart-I:[ItemB]

You have lost customer behavior data. Today you didn't need this data. But tomorrow the product wants to dig deeper into the customer behavior data and that data is non existent.


Backlinks