Terracotta Ehcache : Simpler, faster, distributed

207 views

Published on

Talk given during Devoxx Belgium 2016
https://cfp.devoxx.be/2016/speaker/anthony_dahanne

Caching 101
Caching on the JVM
Clustered Caching with Terracotta Server
Deployment examples

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
207
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Terracotta Ehcache : Simpler, faster, distributed

  1. 1. © 2016 Software AG. All rights reserved. For internal use only TERRACOTTA EHCACHE: SIMPLER, FASTER, DISTRIBUTED DEVOXX BELGIUM NOVEMBER 9TH 2016 ANTHONY DAHANNE @ANTHONYDAHANNE
  2. 2. „Anthony Dahanne, Software Engineer @ Terracotta, a Software AG company „Working on the Terracotta Management Console, and its integration in Terracotta products „And strong Docker supporter :-P , trying to containerize as much as I can ! LET ME INTRODUCE MYSELF „Come visit us at Booth #1 ! Oculus Rift to win !!!
  3. 3. AGENDA Caching 101 Caching on the JVM Clustered Caching with Terracotta Server Deployment examples
  4. 4. CACHING 101
  5. 5. CACHE DEFINITION “Store of things that will be required in the future, and can be retrieved rapidly.” from wiktionary.com A Map (key / value mappings) with capacity control (via eviction) and freshness control (via expiry)
  6. 6. WHERE IS CACHING USED ? from ArsTechnica
  7. 7. LATENCIES TO REMEMBER L1 cache reference 0.5 ns L2 cache reference 7 ns 14x L1 cache Main memory reference 100 ns 20x L2 cache Read 1 MB sequentially from memory 250,000 ns 250 us Round trip within same datacenter 500,000 ns 500 us Read 1 MB sequentially from SSD* 1,000,000 ns 1,000 us 1 ms ~1GB/sec SSD Read 1 MB sequentially from disk 20,000,000 ns 20,000 us 20 ms 80x memory Send packet CA->Netherlands->CA 150 ms 150 ms from github.com/jboner
  8. 8. WHERE IS CACHING USED ? Browser Caching CDN Caching CPU Caching Application Caching Disk Caching
  9. 9. CACHING THEORY : AMDAHL’S LAW “the theoretical speedup is always limited by the part of the task that cannot benefit from the improvement.”, from Wikipedia s : speedup in latency p : percentage of the execution time
  10. 10. CACHING THEORY : THE LONG TAIL
  11. 11. CACHING GLOSSARY • Hit : when the cache returns a value • Miss : when the cache does not have a value • Cold / Hot : when the cache is empty / full
  12. 12. WHAT TO MEASURE WHEN CACHING • Cache Usage (empty ? full ?) • HitRatio : hits / (misses + hits) • HitRate : hits / second
  13. 13. CACHING ON THE JVM
  14. 14. HISTORY OF CACHING ON THE JVM Review Ballot 2001 Public Review 2013 First Release 2003 2.0 “Express” 2010 2.3 Offheap 2011 JSR-107 EHCACHE First Release 2003 Terracotta 5 2016 TERRACOTTA Ehcache3 2016 2009 Ehcache acquisition Public Release 2014
  15. 15. EHCACHE REBOOT : EHCACHE3 • 3.0 (May 2016) • Compatible with JSR 107 (javax.cache) • User managed cache • Copiers & Serializers • Strong typing • 3.1 (Jun 2016) • Clustered tier added • 3.2 (2 days ago) • High Availability with Terracotta Server
  16. 16. CACHING PATTERNS • No Caching • Cache aside • Cache through • Demo ! Business logic Cache GET(K) PUT(K,V) NULL LOAD(K) V SoR K,V K,V Business logic Cache GET(K) LOAD(K) V PUT(K,V) K,V SoR K,VV
  17. 17. CLUSTERED CACHING WITH TERRACOTTA SERVER
  18. 18. TERRACOTTA SERVER RESOURCES from ehcache.org documentation
  19. 19. MULTI CONTAINER DEPLOYMENT PostgreSQL Terracotta Server Webapp with Ehcache3 Clustered Webapp with Ehcache3 Clustered Webapp with Ehcache3 Clustered
  20. 20. DEPLOYMENT EXAMPLES
  21. 21. App Server App Server App Server DEPLOYMENT App Server App Server Ehcache App Server JBOSS SOA-P App Server Ehcache Layer 7 “Presentation Zone” “Application Zone” Individual & Families Issuers 3rd Parties (B2B) 187K simultaneous users / 6K processes requests/s 10’s of Terracotta Servers / 100’s of caching clients
  22. 22. LINKS AND REFERENCES • The essence of caching, by Greg Luck (available on youtube) • Caching 101: Caching on the JVM (and beyond) by Louis Jacomet & Aurelien Broszniowski (available on youtube) • Ehcache3 documentation (available on ehcache.org) • Ehcache3 and Terracotta Server demos (available on github)
  23. 23. © 2016 Software AG. All rights reserved. For internal use only23

×