寻求描述Read-Through非Write-Back缓存的标准术语(单字/短语)
Great question—cache pattern terminology can definitely feel like a maze sometimes, so let's break this down clearly.
First, let's recap the two core behaviors you're referencing to set the stage:
- Read-Through: When your app requests data that's not in the cache, the cache itself fetches the data from the underlying database, populates the cache, and sends it back to your app. That's the read behavior you've described.
- Write-Back (or Write-Behind): When you write to the cache, it immediately confirms the write to your app, then asynchronously saves the change to the database later. This is the write behavior you're explicitly excluding.
Now, for a cache that uses Read-Through for reads but never pushes any write operations back to the database, there are a few standard terms depending on exactly how it's used:
- Read-Only Read-Through Cache: This is the most widely recognized term if the cache is meant to be strictly read-only—meaning your app isn't supposed to write to it at all. It only exists to load data from the database on cache misses and never modifies the underlying store.
- Read-Through with Write-None: If writes to the cache are allowed (but those changes never get saved to the database), this is the precise phrasing to use. The cache acts as a temporary, throwaway store for writes, while still relying on the database for filling missing read data.
- Ephemeral Read-Through Cache: This term highlights that any data written to the cache is transient—it won't be persisted to the database. It's handy for use cases where you want to cache temporary data alongside the Read-Through loaded data from the DB.
In most mainstream caching tools (like Redis, Hazelcast, or Apache Ignite), the "Read-Only Read-Through Cache" is the go-to term for this pattern when writes aren't intended. If writes are allowed but not persisted, "Read-Through with Write-None" is the exact way to describe it.
Just a quick note: this pattern is less common than combinations like Read-Through + Write-Through or Read-Through + Write-Back, since allowing writes without persisting them can lead to inconsistencies between the cache and database. But it's totally valid for scenarios where temporary, non-persistent cache data makes sense.
内容的提问来源于stack exchange,提问作者dhruvbird

