educative.io

Educative

Write through should be more suitable for read-heavy DB

As you have mentioned, it adds latency to every write operation to favour high consistency between cache and DB so all read operation from its callers results in the latest data Ron DB.

2 Likes

Completely agree.

I also had the same question.

@Kayi_Shum Write-through cache is largely used in the use cases where you need strict data consistency between the cache and data source. Additional writes to the cache will add some latency but it will also ensure strict data consistency. This is a trade-off.