Transactional Caching of Application Data using Recent Snapshots - - PowerPoint PPT Presentation

transactional caching of application data using recent
SMART_READER_LITE
LIVE PREVIEW

Transactional Caching of Application Data using Recent Snapshots - - PowerPoint PPT Presentation

Transactional Caching of Application Data using Recent Snapshots Dan R. K. Ports Austin T. Clements Irene Y. Zhang Samuel Madden Barbara Liskov MIT CSAIL How to improve performance of DB-driven web site? Distributed in-memory caching ( e.g.


slide-1
SLIDE 1

Transactional Caching

  • f Application Data

using Recent Snapshots

Dan R. K. Ports Austin T. Clements Irene Y. Zhang Samuel Madden Barbara Liskov MIT CSAIL

slide-2
SLIDE 2

How to improve performance

  • f DB-driven web site?

Distributed in-memory caching (e.g. memcached)

slide-3
SLIDE 3

Distributed In-Memory Caching

Application Database

slide-4
SLIDE 4

Distributed In-Memory Caching

Application Database Cache

slide-5
SLIDE 5
  • in-memory DHT;

very lightweight

  • stores application
  • bjects

(not part of DB)

Distributed In-Memory Caching

Application Database Cache

slide-6
SLIDE 6

Databases work hard to provide transactional consistency. Existing application caches violate these guarantees!

slide-7
SLIDE 7

Consistency Properties

  • ur goal:

consistency: all accesses to cache and database in a transaction see the same snapshot

Can’t guarantee both without blocking! usual goal:

freshness: cache is up-to-date with database

slide-8
SLIDE 8

Consistency Properties

  • ur goal:

consistency: all accesses to cache and database in a transaction see the same snapshot

Can’t guarantee both without blocking! usual goal:

freshness: cache is up-to-date with database

slide-9
SLIDE 9

Embracing Staleness

Run r/o transactions on previous snapshots – avoids blocking – improves cache utilization Safe: stale data is already everywhere! Allow application control over staleness

slide-10
SLIDE 10

TxCache Anatomy

Application Database TxCache Library Cache

slide-11
SLIDE 11

TxCache Anatomy

  • Cache is a versioned DHT,

tagged by validity interval

Application Database TxCache Library Cache

K1 K2 time

slide-12
SLIDE 12

TxCache Anatomy

  • Cache is a versioned DHT,

tagged by validity interval

  • Database returns validity

interval with each query

Application Database TxCache Library Cache SELECT * FROM users… [...result...] VALID FROM t=50 TO t=53

slide-13
SLIDE 13

TxCache Anatomy

  • Cache is a versioned DHT,

tagged by validity interval

  • Database returns validity

interval with each query

  • Library assigns timestamp

to each transaction

  • Uses timestamp to request

data from cache & DB

Application Database TxCache Library Cache

slide-14
SLIDE 14