The story about cache
Upcoming SlideShare
Loading in...5
×
 

The story about cache

on

  • 1,117 views

 

Statistics

Views

Total Views
1,117
Views on SlideShare
1,115
Embed Views
2

Actions

Likes
1
Downloads
10
Comments
0

1 Embed 2

http://paper.li 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

The story about cache The story about cache Presentation Transcript

  • The Story About Cache charsyam@naver.com
  • Use Case: Login
  • Use Case: LoginCommon Case
  • Use Case: Login Common Case Read From DBSelect * from Users where id=‘charsyam’;
  • Use Case: LoginMay be it’s genenallyfast
  • Use Case: LoginBut it’s SlowIn Many Read/Write
  • Use Case: Login Advanced Case Read From CacheGet charsyam
  • Use Case: Loginit’s always fast
  • Use Case: LoginMemcache VS Mysql 136 vs 1613 seconds
  • Use Case: Login250 million User ID Request 10 million
  • Where We Can Use Cache?Just Check User exists? Mail Receive, Tweet MentionGet User’s ProfileGet User’s Timeline
  • CachesMemcache Redis
  • MemcacheAtomic Operation
  • MemcacheAtomic Operation Key:Value
  • MemcacheAtomic Operation Key:Value Single Thread
  • Memcache Processing Over 100,000 TPS
  • RedisKey:Value
  • RedisKey:Value Collection List Sorted Set
  • Cache Layer Storage Layer Cache Application READ WRITE Server UPDATE WRITE DBMS
  • Cache Layer Like Twitter K: UserID, V: Y/N 1st Level Cache Check User exists K: UserID_TIMELINE, V: Tweet IDs 2nd Level Cache Check tweet list K: UserID_TWEETID, V: Tweet Contents 3rd Level Cache Check Content
  • BUTsSometimes Cache is slower than DB
  • Why?DBMS Also Uses CacheIf Cache is hit. It’s faster than …
  • DBMS Storage Layer Application READ Cache Server DBMS WRITE
  • EnvironmentSmall Data SetsRead Just 0.2~03mili
  • ComparisionDB’s Cache: 0.2milimemCache: 0.4mili If you check cache, you spend more time
  • BUTs BUTsCache helps to reduceDBMS’s Loads And It reduces Performance Deviation
  • Use Cache!
  • Thank you!