Ehcache's Writer API Screencast

A common pattern to offloading the database is to use a cache in front of it. Yet, generally, it’s still application code that goes to the underlying system of records for writes. It also then becomes responsible for invalidating or updating cached entries.

Using cache writers can not only automate that aspect, but also enables you to scale your writes. This 5 minute screencast explains how to use Ehcache Writer API to achieve this and what it means to your application code: especially in distributed environments when clustering your caches with Terracotta, the contract becomes looser than the usual “happens once and only once”. Indeed, updates to the database will happen at least once. In case of failure entries could get updated more than once…

You can also download the Ehcache Raffle application, that demonstrates Cache Writers and Cache Loaders, from github.com.