Why you should avoid updating data

E

Updating data causes a lot of the problems we struggle with in our systems:

  • Updating data cause data loss.
  • Updating data cause concurrency problems.
  • Updating data requires complex transactional processing or compensation logic.

So, why do we keep updating our data?

Cloud storage is abundant, and super cheap.

There is no reason for throwing data away anymore these days.

There is no reason to introduce concurrency problems in our apps.

Instead prefer append only data models.

There are plenty to choose from:

  • Business native append-only models such as Journaling (in Accounting), Auditing (in Access Control), etc...
  • Event Sourcing can be used to model any business capability or process step.
  • When you need state, look into Conflict Free Replicated Data Types (CRDT's) to represent it.

Consider defaulting to these techniques.

Unless you intentionally want to throw data away...

About the author

YVES GOELEVEN

I've been a software architect for over 20 years.

My main areas of expertise are large scale distributed systems, progressive web applications, event driven architecture, domain driven design, event sourcing, messaging, and the Microsoft Azure platform.

As I've transitioned into the second half of my career, I made it my personal goal to train the next generation of software architects.

Get in touch

Want to get better at software architecture?

Sign up to my newsletter and get regular advice to improve your architecture skills.

You can unsubscribe at any time by clicking the link in the footer of your emails. I use Mailchimp as my marketing platform. By clicking subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.