Your SlideShare is downloading. ×
  • Like
The story about cache
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

The story about cache



  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. The Story About Cache
  • 2. Use Case: Login
  • 3. Use Case: LoginCommon Case
  • 4. Use Case: Login Common Case Read From DBSelect * from Users where id=‘charsyam’;
  • 5. Use Case: LoginMay be it’s genenallyfast
  • 6. Use Case: LoginBut it’s SlowIn Many Read/Write
  • 7. Use Case: Login Advanced Case Read From CacheGet charsyam
  • 8. Use Case: Loginit’s always fast
  • 9. Use Case: LoginMemcache VS Mysql 136 vs 1613 seconds
  • 10. Use Case: Login250 million User ID Request 10 million
  • 11. Where We Can Use Cache?Just Check User exists? Mail Receive, Tweet MentionGet User’s ProfileGet User’s Timeline
  • 12. CachesMemcache Redis
  • 13. MemcacheAtomic Operation
  • 14. MemcacheAtomic Operation Key:Value
  • 15. MemcacheAtomic Operation Key:Value Single Thread
  • 16. Memcache Processing Over 100,000 TPS
  • 17. RedisKey:Value
  • 18. RedisKey:Value Collection List Sorted Set
  • 19. Cache Layer Storage Layer Cache Application READ WRITE Server UPDATE WRITE DBMS
  • 20. 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
  • 21. BUTsSometimes Cache is slower than DB
  • 22. Why?DBMS Also Uses CacheIf Cache is hit. It’s faster than …
  • 23. DBMS Storage Layer Application READ Cache Server DBMS WRITE
  • 24. EnvironmentSmall Data SetsRead Just 0.2~03mili
  • 25. ComparisionDB’s Cache: 0.2milimemCache: 0.4mili If you check cache, you spend more time
  • 26. BUTs BUTsCache helps to reduceDBMS’s Loads And It reduces Performance Deviation
  • 27. Use Cache!
  • 28. Thank you!