Data flow is: application -> cache -> database (i.e. cache sits in between the application and the database).

There are 3 strategies:

  • Write through: write to both in parallel.
  • Write around: database only.
  • Write back: cache only.

It basically depends on whether, during a write, the application writes to the underlying database, cache or both.