Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Caching, why not?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
dkovalenko
July 11, 2015
Technology
1
77
Caching, why not?
Highload meetup: talks by Megogo, 2015
dkovalenko
July 11, 2015
Tweet
Share
Other Decks in Technology
See All in Technology
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.1k
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
1
190
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.6k
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
130
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
500
Webhook best practices for rock solid and resilient deployments
glaforge
1
260
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
1
270
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
570
今日から始めるAmazon Bedrock AgentCore
har1101
4
390
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
850
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Are puppies a ranking factor?
jonoalderson
1
2.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Being A Developer After 40
akosma
91
590k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
The SEO Collaboration Effect
kristinabergwall1
0
350
Automating Front-end Workflow
addyosmani
1371
200k
Statistics for Hackers
jakevdp
799
230k
How STYLIGHT went responsive
nonsquared
100
6k
Marketing to machines
jonoalderson
1
4.6k
Transcript
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?