Consistency between Cache and Database, Part 1

Chunting Wu
Starbugs Weekly 星巴哥技術專欄
8 min readJul 3, 2022

--

Photo by Jesse Collins on Unsplash

Today we are going to talk about consistency, especially the consistency of data between cache and database. This is actually an important topic, particularly as the size of an organization increases, the requirements for consistency will grow and so will the implementation of consistency.

For example, a startup service will not have a higher Service Level Agreement, aka SLA, than a mature service. For a startup service, a data consistency SLA of four nines (99.99%) might be considered high, but for a mature service like AWS S3, the data SLA is as high as 11 nines.

We all know that for every nine, the difficulty and complexity of the implementation will increase in an exponential way, so for a startup service, there are basically no resources to maintain a very high SLA.

Thus, how can we use the resources as effectively as possible to improve consistency? That’s what this article will introduce. Again, the consistency mentioned here refers specifically to the consistency between cache and database data.

Why Caching?

I believe we all agree that inconsistencies are inevitable when we put data in two different storages. So what makes us put data into…

--

--

Chunting Wu
Starbugs Weekly 星巴哥技術專欄

Architect at SHOPLINE. Experienced in system design, backend development, and data engineering.