Demand Cache (1)
23
Data
Source
Client
②Respond
data in cache
キャッシュからの取得を試み、
キャッシュにあればそれを使用
Cache
①Try to read
from cache
Slide 24
Slide 24 text
Demand Cache (2)
24
Data
Source
Client
①Try to read
from cache
②Read from
data source
if cache missed
キャッシュになかった場合、
データソースに問合せる
Cache
Slide 25
Slide 25 text
③Store requested
data to cache
Demand Cache (2)
25
Data
Source
Client
①Try to read
from cache
④Respond data
from data source データソースからのデータを返す
とともに、キャッシュにデータを保
存し、次回以降の問合せに備え
る
Cache
②Read from
data source
if cache missed
Slide 26
Slide 26 text
③Store requested
data to cache
Demand Cache (2)
26
Data
Source
Client
①Try to read
from cache
④Respond data
from data source
◉ 使用されるデータの予測ができないユースケースでも適用可能
◉ ヒット率等の要因でパフォーマンスにばらつきが出る事がある
Cache
②Read from
data source
if cache missed
31
Client
Outside
Cache
Local Caching
①Try to read from
on-memory cache
②Try to read from
outside cache
if on-memory cache
missed
Demand Cacheにおけるキャッシュとデータ
ソース間と同じ処理を、クライアント上のメモリ
とキャッシュ間でも行う
On-memory
Cache
Slide 32
Slide 32 text
④Store requested
data to cache
Demand Cache with
Local Caching
32
Data
Source
Client
②Try to read
from outside
cache
③Read from
data source
⑤Respond data
from data source
◉ このように組み合わせて使うことも多い
○ データソースとキャッシュ間に差異が生まれやすいため、キャッ
シュデータのライフサイクル管理が重要!!
Outside
Cache
①Try to read
from on-memory
cache
⑥Store requested
data to on-memory
cache
On-memory
Cache