le cache - principes avancés - devoxx

54
9h30- 12h30 - Salle XX Le cache – Principes avancés

Upload: mathildelemee

Post on 23-Jun-2015

199 views

Category:

Documents


1 download

DESCRIPTION

Hands on Cache - Devoxx

TRANSCRIPT

Page 1: Le Cache - Principes avancés - Devoxx

9h30- 12h30 - Salle XX

Le cache – Principes avancés

Page 2: Le Cache - Principes avancés - Devoxx

27 au 29 mars 2013

Pratiques de caching avancées

Aurélien BroszniowskiMathile Lemée

Ingénieurs R&D – Software AG

@AurBroszniowski@MathildeLemee

Page 3: Le Cache - Principes avancés - Devoxx

Aurélien Broszniowski

•Ingénieur lead @ Terracotta

•Tester Terracotta/Ehcache/Quartz

•Tester un système distribué… Comment faire?

•www.takeon.me

•CEO, CTO, CFO, Marketing, Architecte, Développeur, Testeur…

Page 4: Le Cache - Principes avancés - Devoxx

Mathilde Lemée

•Ehcache/Terracotta

•DuchessFR

•FluentLenium, wrapper autour de Selenium

•Aetys, studio mobile

Page 5: Le Cache - Principes avancés - Devoxx

Le cache

TODO desc caching

Page 6: Le Cache - Principes avancés - Devoxx

Le cache

TODO desc caching

Cacher…Pourquoi?Comment?

Page 7: Le Cache - Principes avancés - Devoxx
Page 8: Le Cache - Principes avancés - Devoxx

HOTSET+ PROXIMITE

Page 9: Le Cache - Principes avancés - Devoxx
Page 10: Le Cache - Principes avancés - Devoxx

…OF YOUR CACHE

Page 11: Le Cache - Principes avancés - Devoxx

Chacun dans son coin…

Page 12: Le Cache - Principes avancés - Devoxx

…partager c’est mieux!

Page 13: Le Cache - Principes avancés - Devoxx

Parallélismeetdistribution

Page 14: Le Cache - Principes avancés - Devoxx

Pourquoi le caching?- Hotset- Proximité- Partage- Distribution

- Vitesse!!!!

Page 15: Le Cache - Principes avancés - Devoxx

Cache Aside

"Par ma foi ! Il y a plus de quarante ans que je dis de la prose sans que j'en susse rien. "  Molière ; Le

Bourgeois gentilhomme

Page 16: Le Cache - Principes avancés - Devoxx

Cache aside

Database

Application

CacheCache

DAODAO

Get AGet B

Read B

Put BGet B

Page 17: Le Cache - Principes avancés - Devoxx

Cache as a System of Record

Page 18: Le Cache - Principes avancés - Devoxx

Cache as a s-o-r : read through

Database

Application

EhcacheEhcache

Persistence layerPersistence layer

Get AGet B

Read B

Put BGet B

Page 19: Le Cache - Principes avancés - Devoxx

Cache as a s-o-r : Write through

Database

Application

EhcacheEhcache

Persistence layerPersistence layer

Write A

Put A

Page 20: Le Cache - Principes avancés - Devoxx

Cache as a s-o-r : Write-behind

Database

Application

EhcacheEhcache

Persistence layerPersistence layer

Put A

Write-behind thread

Write-behind thread

Put BPut CPut D

Get A B C D

Write A B C D

Page 21: Le Cache - Principes avancés - Devoxx

Write Through – Temps de réponses

Page 22: Le Cache - Principes avancés - Devoxx

Write Behind – Temps de réponses

Page 23: Le Cache - Principes avancés - Devoxx

Write Through – Database load

Page 24: Le Cache - Principes avancés - Devoxx

Write Behind – Database load

Page 25: Le Cache - Principes avancés - Devoxx

Refresh Ahead

Page 26: Le Cache - Principes avancés - Devoxx

Cache Aside vs Read/Write Through

Page 27: Le Cache - Principes avancés - Devoxx

Refresh Ahead vs Read Through

Page 28: Le Cache - Principes avancés - Devoxx

Write Behind vs Write Through

Page 29: Le Cache - Principes avancés - Devoxx

Partie 2 – Fonctionnalités avançées

Page 30: Le Cache - Principes avancés - Devoxx

Search

Page 31: Le Cache - Principes avancés - Devoxx

Search

Results results = cache.createQuery().includeValues()

.addCriteria(age.eq(32).and(gender.eq("male")))

.execute();

Page 32: Le Cache - Principes avancés - Devoxx

Du cache au data store

Page 33: Le Cache - Principes avancés - Devoxx

Recharge le cache en cas d’arrêt…

…ou de crash.

Page 34: Le Cache - Principes avancés - Devoxx

Choisir où stocker ses données…

Page 35: Le Cache - Principes avancés - Devoxx

Allocation de la mémoire

Page 36: Le Cache - Principes avancés - Devoxx

Allocation de la mémoire

Par unité

Page 37: Le Cache - Principes avancés - Devoxx

Allocation de la mémoire

Par espace mémoire

Page 38: Le Cache - Principes avancés - Devoxx

Allocation de la mémoire

Automatique

Page 39: Le Cache - Principes avancés - Devoxx

Partie 3 – La Scalabilité

Page 40: Le Cache - Principes avancés - Devoxx

Verticale

SCALABILITE

Page 41: Le Cache - Principes avancés - Devoxx

Tant que ca marche…

Page 42: Le Cache - Principes avancés - Devoxx

Scalabilité Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Scalabilité

Horizontale

Page 43: Le Cache - Principes avancés - Devoxx

Offheap

Page 44: Le Cache - Principes avancés - Devoxx
Page 45: Le Cache - Principes avancés - Devoxx
Page 46: Le Cache - Principes avancés - Devoxx
Page 47: Le Cache - Principes avancés - Devoxx
Page 48: Le Cache - Principes avancés - Devoxx

Near Cache

Page 49: Le Cache - Principes avancés - Devoxx

Partie 4 – Réplication WAN

Page 50: Le Cache - Principes avancés - Devoxx
Page 51: Le Cache - Principes avancés - Devoxx

WAN 3

Page 52: Le Cache - Principes avancés - Devoxx
Page 53: Le Cache - Principes avancés - Devoxx

Solutions

solutions des bonus

Page 54: Le Cache - Principes avancés - Devoxx

Automatic Resource Controlhttp://jsoftbiz.wordpress.com/2011/08/01/ehcache-2-5-goes-beta-explanation-included/Etudes de cas Write Behind / Write Through :

http://www.infoq.com/articles/write-behind-cachinghttp://ehcache.org/documentation/recipes/wan