- Write-Through
- Pros
- No risk of data loss.
- Cons
- Slow (cache can only ack back until writing data to database successfully).
- When a new cache node is added, the new cache node will be empty until there is a update from the application.
- Pros
- Write-Behind
- Pros
- Faster (cache can ack back without writing data to database).
- Cons
- Risk of data loss: Data may lose after cache goes down, but before it have been written to database.
- More complex to implement.
- Pros
- Refresh-ahead
- Pros
- Faster
- Cons
- Not accurately predicting which items are likely to be needed in the future can result in reduced performance than without refresh-ahead.
- Pros
Topic | Consideration | Possible Solution Options |
---|