Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Caching, why not?
Search
dkovalenko
July 11, 2015
Technology
92
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Caching, why not?
Highload meetup: talks by Megogo, 2015
dkovalenko
July 11, 2015
Transcript
31 slides
Caching, why not? Highload Meetup: talks by Megogo
About me • Dmitriy Kovalenko @dkovalenko_fun • TeamLead @ x2sy:
Megogo • Actively using: Scala, php • Also: Clojure, golang
About us • > 4 million users every day •
> 30000 hours of video content • Web, iOS, Android, SmartTV, OTT Boxes • CIS, Baltics, Europe
Agenda • Caching across tiers: 1. Browser 2. Frontend server/proxy
3. Application • Cache infrastructure • Microservices and caching
Speedup your Application
None
None
• Cache-control • Max-Age, S-Max-Age (seconds) • Expires • ETag
(If-None-Match) Headers
None
Use CDN, Carl! • Move your Images, JS, CSS ->
CDN • Assets minifying, response gzipping
Use your Frontend/ Cacher/ Proxy
Reverse proxy • Varnish Cache • Nginx • Use your
cache store directly (CouchDB, Memcached) • Split your page, think about SSI/ESI includes
None
frontend server caching pros: • High speed • Zero overhead
for application • Usually can be applied without application change
frontend server caching cons: • Hard to debug • Hard
to get right • Changes in application needs additional synchronization
Application cache pros: • Much controllable than frontend cache •
Can use Application context • Swapping implementations in not a problem
Problems to think about • Key selection, Cache Tags •
Invalidation schema • Cold start/full flush • Dogpile effect • Embedded or External • Local or Distibuted
<?php $data = $cache->get('some_key'); if ($data === false) { $data
= getFromDB(); $cache->set($data); } return $data;
Cache slam problem
Eviction strategies • LRU • LFU • FIFO • Lifetime
Cache in cluster CP DB Service 2 WEB API Service
2
Going further with Microservices
There are only two hard things in Computer Science: cache
invalidation and naming things. ! -- Phil Karlton
Solutions • Nodes list • Shared/Distributed caches • Master invalidates
slaves • Queue • Cache cleaner • ETag FTW!
None
None
None
None
None
None
Great caching is like great sex. It hides all the
real problems. ! @vivekhaldar Questions?
Other Decks in Technology
See All in Technology
CloudTrail を推したい
kazzpapa3
0
110
田んぼの見回りをIoTで減らしたい!水位監視から電池駆動カメラまでの試行錯誤
itosoft
1
250
仕様と現実の間で落とし所を探るリモートMCPの認証・認可 — Sansanの認証基盤における課題と実践
sansantech
PRO
2
330
おうち環境でも「なるべく止めたくない!」 ― おうち環境の機器冗長化の理想と現実
yuutosi
1
500
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
120
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
110
AIネイティブ組織の作り方。1人のPOとAIから始める、自社での実験
ama_ch
2
1.1k
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
1
450
市販IoT機器や自作IoT機器とHomeAssistantを駆使して家の電気代をできる限り見える化する方法の考案
harutiro
0
310
Where Should Platform Complexity Live? Lessons from a Cross-Team PR Preview Platform
taiki45
0
120
Sonnetだけで業務はまわる?
kintotechdev
1
140
Datadog の権限統制 〜Org 統合に向けて調べた注意点 / JDDUG-Meetup_24
visional_engineering_and_design
1
160
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
300
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
240
The World Runs on Bad Software
bkeepers
PRO
72
12k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Building an army of robots
kneath
307
47k