Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
@ljacomet#ehcachedvx
Caching reboot
javax.cache & Ehcache 3
@ljacomet#ehcachedvx
Agenda
@ljacomet#ehcachedvx
Agenda
• Why a cache?
@ljacomet#ehcachedvx
Agenda
• Why a cache?
• JSR-107
• APIs and features
• Provider extensions
@ljacomet#ehcachedvx
Agenda
• Why a cache?
• JSR-107
• APIs and features
• Provider extensions
• Caching in an application...
@ljacomet#ehcachedvx
Agenda
• Why a cache?
• JSR-107
• APIs and features
• Provider extensions
• Caching in an application...
@ljacomet#ehcachedvx
Agenda
• Why a cache?
• JSR-107
• APIs and features
• Provider extensions
• Caching in an application...
@ljacomet#ehcachedvx
Who am I?
• Louis Jacomet
• Software engineer, closer to 40 than 20 and still coding!
• Engineer at T...
Why a cache?
@ljacomet#ehcachedvx
Why a cache?
@ljacomet#ehcachedvx
What were these numbers?
@ljacomet#ehcachedvx
What were these numbers?
• Minute:
• L1$cache$access$$$$$$$$$$$$$$$0,5$s$$$One$heartbeat$
• Branch$mi...
@ljacomet#ehcachedvx
What were these numbers?
• Minute:
• L1$cache$access$$$$$$$$$$$$$$$0,5$s$$$One$heartbeat$
• Branch$mi...
@ljacomet#ehcachedvx
What were these numbers?
• Minute:
• L1$cache$access$$$$$$$$$$$$$$$0,5$s$$$One$heartbeat$
• Branch$mi...
@ljacomet#ehcachedvx
What were these numbers?
@ljacomet#ehcachedvx
What were these numbers?
• Week:
• Random$read$SSD$$$$$$$$$$$$$$$$$1,7$d$$$$$$$A$weekNend$
• Sequence...
@ljacomet#ehcachedvx
What were these numbers?
• Week:
• Random$read$SSD$$$$$$$$$$$$$$$$$1,7$d$$$$$$$A$weekNend$
• Sequence...
@ljacomet#ehcachedvx
What were these numbers?
• Week:
• Random$read$SSD$$$$$$$$$$$$$$$$$1,7$d$$$$$$$A$weekNend$
• Sequence...
@ljacomet#ehcachedvx
So what is a cache?
@ljacomet#ehcachedvx
So what is a cache?
• Data structure holding a temporary copy of some data
@ljacomet#ehcachedvx
So what is a cache?
• Data structure holding a temporary copy of some data
• Trade off between higher...
@ljacomet#ehcachedvx
So what is a cache?
• Data structure holding a temporary copy of some data
• Trade off between higher...
@ljacomet#ehcachedvx
Ehcache (3)
@ljacomet#ehcachedvx
Ehcache (3)
• New version, fully integrated with JSR-107
• Breaks compatibility with 2.x line
@ljacomet#ehcachedvx
Ehcache (3)
• New version, fully integrated with JSR-107
• Breaks compatibility with 2.x line
• Devel...
@ljacomet#ehcachedvx
Ehcache (3)
• New version, fully integrated with JSR-107
• Breaks compatibility with 2.x line
• Devel...
JSR-107 - javx.caching
@ljacomet#ehcachedvx
JSR-107
@ljacomet#ehcachedvx
JSR-107
• Ancient JSR
• Started in 2001
• Approved a year ago (March 2014)
@ljacomet#ehcachedvx
JSR-107
• Ancient JSR
• Started in 2001
• Approved a year ago (March 2014)
• javax.caching API + TCK ...
@ljacomet#ehcachedvx
JSR-107
• Ancient JSR
• Started in 2001
• Approved a year ago (March 2014)
• javax.caching API + TCK ...
@ljacomet#ehcachedvx
JSR-107 : Features
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
•Integration
•CacheLoade...
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
•Integration
•CacheLoade...
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
•Integration
•CacheLoade...
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
•Integration
•CacheLoade...
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
•Integration
•CacheLoade...
@ljacomet#ehcachedvx
JSR-107 : Features
•CacheManager / Cache
•Expiration
•Creation/Access/Update
•Integration
•CacheLoade...
@YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx
Demo
@YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx
And my XML??
@ljacomet#ehcachedvx
JSR-107 configuration
• Programmatic only
• Enter the world of provider extensions
• Ehcache 3 expect...
@YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx
Demo
Caching in an application
@ljacomet#ehcachedvx
public BusinessObject computeAndWin(String param1,
String param2) {


String key = createKey(param1, ...
@ljacomet#ehcachedvx
Cache Aside : not so easy
@ljacomet#ehcachedvx
Cache Aside : not so easy
• Requires synchronisation between
• cache
• and system of record
@ljacomet#ehcachedvx
Cache Aside : not so easy
• Requires synchronisation between
• cache
• and system of record
• JSR-107...
@ljacomet#ehcachedvx
Cache Aside : not so easy
• Requires synchronisation between
• cache
• and system of record
• JSR-107...
@ljacomet#ehcachedvx
Cache Aside: options
@ljacomet#ehcachedvx
Cache Aside: options
• Rely on the abstraction of your framework
• Spring Caching
• Hibernate
• …
@ljacomet#ehcachedvx
Cache Aside: options
• Rely on the abstraction of your framework
• Spring Caching
• Hibernate
• …
• A...
@ljacomet#ehcachedvx
public BusinessObject computeAndWin(String param1,
String param2) {


return cache.get(createKey(para...
@ljacomet#ehcachedvx
Cache Through
Cache
Application
code
RDBMS
@ljacomet#ehcachedvx
Cache Through
Cache
Application
code
RDBMS
@ljacomet#ehcachedvx
Cache Through
Cache
Application
code
RDBMS
@ljacomet#ehcachedvx
Cache Through
Cache
Application
code
RDBMS
@ljacomet#ehcachedvx
Cache Through
Cache
Application
code
RDBMS
@ljacomet#ehcachedvx
Cache Through
@ljacomet#ehcachedvx
Cache Through
• get* => CacheLoader
• cache miss indicates no data available
@ljacomet#ehcachedvx
Cache Through
• get* => CacheLoader
• cache miss indicates no data available
• put* => CacheWriter
• ...
@ljacomet#ehcachedvx
Cache Through
• get* => CacheLoader
• cache miss indicates no data available
• put* => CacheWriter
• ...
@ljacomet#ehcachedvx
Cache Through : JSR-107
@ljacomet#ehcachedvx
Cache Through : JSR-107
• Peculiar behaviours
@ljacomet#ehcachedvx
Cache Through : JSR-107
• Peculiar behaviours
• putIfAbsent(K key,V value): boolean
@ljacomet#ehcachedvx
Cache Through : JSR-107
• Peculiar behaviours
• putIfAbsent(K key,V value): boolean
• Ignores CacheLo...
@ljacomet#ehcachedvx
Cache Through : JSR-107
• Peculiar behaviours
• putIfAbsent(K key,V value): boolean
• Ignores CacheLo...
@ljacomet#ehcachedvx
Cache Through : JSR-107
• Peculiar behaviours
• putIfAbsent(K key,V value): boolean
• Ignores CacheLo...
@ljacomet#ehcachedvx
Cache Through : Write Behind
@ljacomet#ehcachedvx
Cache Through : Write Behind
• Asynchronous writes to the the system of record
• User thread no longe...
@ljacomet#ehcachedvx
Cache Through : Write Behind
• Asynchronous writes to the the system of record
• User thread no longe...
Resilience strategy
@ljacomet#ehcachedvx
Resilience strategy
@ljacomet#ehcachedvx
Resilience strategy
• Proposition:
“A cache level error
should not be the cause for
a user level erro...
@ljacomet#ehcachedvx
Resilience strategy
• Proposition:
“A cache level error
should not be the cause for
a user level erro...
@ljacomet#ehcachedvx
Ehcache 3
@ljacomet#ehcachedvx
Ehcache 3
• Handle errors internally as much as possible
@ljacomet#ehcachedvx
Ehcache 3
• Handle errors internally as much as possible
• In memory cache => No exceptions in the ex...
@ljacomet#ehcachedvx
Ehcache 3
• Handle errors internally as much as possible
• In memory cache => No exceptions in the ex...
@ljacomet#ehcachedvx
Ehcache 3
• Handle errors internally as much as possible
• In memory cache => No exceptions in the ex...
@ljacomet#ehcachedvx
Ehcache 3
• Handle errors internally as much as possible
• In memory cache => No exceptions in the ex...
@ljacomet#ehcachedvx
Ehcache 3
• Handle errors internally as much as possible
• In memory cache => No exceptions in the ex...
Ehcache 3 and Terracotta
@ljacomet#ehcachedvx
Offheap solution
@ljacomet#ehcachedvx
Offheap solution
• Solving Garbage Collector pauses on large heaps
@ljacomet#ehcachedvx
Offheap solution
• Solving Garbage Collector pauses on large heaps
• Enables extreme cache scale up
•...
@ljacomet#ehcachedvx
Offheap solution
• Solving Garbage Collector pauses on large heaps
• Enables extreme cache scale up
•...
@ljacomet#ehcachedvx
Clustering solution
@ljacomet#ehcachedvx
Clustering solution
• Sharing of data across multiple JVMs
@ljacomet#ehcachedvx
Clustering solution
• Sharing of data across multiple JVMs
• Terracotta 4.3.0 again has an OpenSource...
@ljacomet#ehcachedvx
Clustering solution
• Sharing of data across multiple JVMs
• Terracotta 4.3.0 again has an OpenSource...
@YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx
Questions ?
Upcoming SlideShare
Loading in …5
×

Caching reboot: javax.cache & Ehcache 3

705 views

Published on

Session given on June 22nd 2015 during Devoxx Poland 2015

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Caching reboot: javax.cache & Ehcache 3

  1. 1. @ljacomet#ehcachedvx Caching reboot javax.cache & Ehcache 3
  2. 2. @ljacomet#ehcachedvx Agenda
  3. 3. @ljacomet#ehcachedvx Agenda • Why a cache?
  4. 4. @ljacomet#ehcachedvx Agenda • Why a cache? • JSR-107 • APIs and features • Provider extensions
  5. 5. @ljacomet#ehcachedvx Agenda • Why a cache? • JSR-107 • APIs and features • Provider extensions • Caching in an application • Cache aside • Cache through
  6. 6. @ljacomet#ehcachedvx Agenda • Why a cache? • JSR-107 • APIs and features • Provider extensions • Caching in an application • Cache aside • Cache through • Resilience strategy
  7. 7. @ljacomet#ehcachedvx Agenda • Why a cache? • JSR-107 • APIs and features • Provider extensions • Caching in an application • Cache aside • Cache through • Resilience strategy • Extras
  8. 8. @ljacomet#ehcachedvx Who am I? • Louis Jacomet • Software engineer, closer to 40 than 20 and still coding! • Engineer at Terracotta (Software AG) since 2013 • Working on Ehcache OS and EE mostly • team manager and fiddling in infrastructure • No idea how to do a (nice) UI - especially a web one • Enjoys concurrency, thinking hard about APIs, …
  9. 9. Why a cache?
  10. 10. @ljacomet#ehcachedvx Why a cache?
  11. 11. @ljacomet#ehcachedvx What were these numbers?
  12. 12. @ljacomet#ehcachedvx What were these numbers? • Minute: • L1$cache$access$$$$$$$$$$$$$$$0,5$s$$$One$heartbeat$ • Branch$misprediction$$$$$$$$$$5$$$s$$$Yawn$ • L2$cache$access$$$$$$$$$$$$$$$7$$$s$$$Long$yawn$ • Mutex$lock/unlock$$$$$$$$$$$$25$$$s$$$Coffee$preparation
  13. 13. @ljacomet#ehcachedvx What were these numbers? • Minute: • L1$cache$access$$$$$$$$$$$$$$$0,5$s$$$One$heartbeat$ • Branch$misprediction$$$$$$$$$$5$$$s$$$Yawn$ • L2$cache$access$$$$$$$$$$$$$$$7$$$s$$$Long$yawn$ • Mutex$lock/unlock$$$$$$$$$$$$25$$$s$$$Coffee$preparation • Hour: • RAM$access$$$$$$$$$$$$$$$$$$100$$$s$$$Brushing$your$teeth$ • Compressing$1K$$$$$$$$$$$$$$$50$$$min$One$TV$show$episode
  14. 14. @ljacomet#ehcachedvx What were these numbers? • Minute: • L1$cache$access$$$$$$$$$$$$$$$0,5$s$$$One$heartbeat$ • Branch$misprediction$$$$$$$$$$5$$$s$$$Yawn$ • L2$cache$access$$$$$$$$$$$$$$$7$$$s$$$Long$yawn$ • Mutex$lock/unlock$$$$$$$$$$$$25$$$s$$$Coffee$preparation • Hour: • RAM$access$$$$$$$$$$$$$$$$$$100$$$s$$$Brushing$your$teeth$ • Compressing$1K$$$$$$$$$$$$$$$50$$$min$One$TV$show$episode • Day: • 2KB$sent$on$1GB$network$$$$$$$5,5$h$$$Your$work$afternoon
  15. 15. @ljacomet#ehcachedvx What were these numbers?
  16. 16. @ljacomet#ehcachedvx What were these numbers? • Week: • Random$read$SSD$$$$$$$$$$$$$$$$$1,7$d$$$$$$$A$weekNend$ • Sequence$read$1$MB$from$RAM$$$$$2,9$d$$$$$$$A$long$weekNend$ • Round$trip$in$datacenter$$$$$$$$5,8$d$$$$$$$Holidays$ • Sequence$read$1MB$from$SSD$$$$$11,6$d$$$$$$$Two$weeks$delivery
  17. 17. @ljacomet#ehcachedvx What were these numbers? • Week: • Random$read$SSD$$$$$$$$$$$$$$$$$1,7$d$$$$$$$A$weekNend$ • Sequence$read$1$MB$from$RAM$$$$$2,9$d$$$$$$$A$long$weekNend$ • Round$trip$in$datacenter$$$$$$$$5,8$d$$$$$$$Holidays$ • Sequence$read$1MB$from$SSD$$$$$11,6$d$$$$$$$Two$weeks$delivery • Year: • Seek$on$rotational$HDD$$$$$$$$$16,5$weeks$$$School$semester$ • Sequence$read$1MB$from$HDD$$$$$$7,8$months$$Almost$a$baby
  18. 18. @ljacomet#ehcachedvx What were these numbers? • Week: • Random$read$SSD$$$$$$$$$$$$$$$$$1,7$d$$$$$$$A$weekNend$ • Sequence$read$1$MB$from$RAM$$$$$2,9$d$$$$$$$A$long$weekNend$ • Round$trip$in$datacenter$$$$$$$$5,8$d$$$$$$$Holidays$ • Sequence$read$1MB$from$SSD$$$$$11,6$d$$$$$$$Two$weeks$delivery • Year: • Seek$on$rotational$HDD$$$$$$$$$16,5$weeks$$$School$semester$ • Sequence$read$1MB$from$HDD$$$$$$7,8$months$$Almost$a$baby • Decade: • Data$roundNtrip$around$the$world$4,8$years$$PhD$thesis
  19. 19. @ljacomet#ehcachedvx So what is a cache?
  20. 20. @ljacomet#ehcachedvx So what is a cache? • Data structure holding a temporary copy of some data
  21. 21. @ljacomet#ehcachedvx So what is a cache? • Data structure holding a temporary copy of some data • Trade off between higher memory usage for reduced latency
  22. 22. @ljacomet#ehcachedvx So what is a cache? • Data structure holding a temporary copy of some data • Trade off between higher memory usage for reduced latency • Targets : • Data which is reused • Data which is expensive to compute or retrieve
  23. 23. @ljacomet#ehcachedvx Ehcache (3)
  24. 24. @ljacomet#ehcachedvx Ehcache (3) • New version, fully integrated with JSR-107 • Breaks compatibility with 2.x line
  25. 25. @ljacomet#ehcachedvx Ehcache (3) • New version, fully integrated with JSR-107 • Breaks compatibility with 2.x line • Developed in the open • https://github.com/ehcache/ehcache3
  26. 26. @ljacomet#ehcachedvx Ehcache (3) • New version, fully integrated with JSR-107 • Breaks compatibility with 2.x line • Developed in the open • https://github.com/ehcache/ehcache3 • Public dev meeting, almost weekly, on hangouts on air • Recordings available onYoutube
  27. 27. JSR-107 - javx.caching
  28. 28. @ljacomet#ehcachedvx JSR-107
  29. 29. @ljacomet#ehcachedvx JSR-107 • Ancient JSR • Started in 2001 • Approved a year ago (March 2014)
  30. 30. @ljacomet#ehcachedvx JSR-107 • Ancient JSR • Started in 2001 • Approved a year ago (March 2014) • javax.caching API + TCK + reference implementation • Eases integration of a cache in frameworks
  31. 31. @ljacomet#ehcachedvx JSR-107 • Ancient JSR • Started in 2001 • Approved a year ago (March 2014) • javax.caching API + TCK + reference implementation • Eases integration of a cache in frameworks • Ongoing discussions about a version 2.0 • Async API for example
  32. 32. @ljacomet#ehcachedvx JSR-107 : Features
  33. 33. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache
  34. 34. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update
  35. 35. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update •Integration •CacheLoader / Writer
  36. 36. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update •Integration •CacheLoader / Writer •CacheEntryListener •Created/Updated •Removed/Expired •Get old value
  37. 37. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update •Integration •CacheLoader / Writer •CacheEntryListener •Created/Updated •Removed/Expired •Get old value •Entry processor
  38. 38. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update •Integration •CacheLoader / Writer •CacheEntryListener •Created/Updated •Removed/Expired •Get old value •Entry processor •Annotations
  39. 39. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update •Integration •CacheLoader / Writer •CacheEntryListener •Created/Updated •Removed/Expired •Get old value •Entry processor •Annotations •MBeans, exposing •Configuration •Statistics
  40. 40. @ljacomet#ehcachedvx JSR-107 : Features •CacheManager / Cache •Expiration •Creation/Access/Update •Integration •CacheLoader / Writer •CacheEntryListener •Created/Updated •Removed/Expired •Get old value •Entry processor •Annotations •MBeans, exposing •Configuration •Statistics •No capacity control !
  41. 41. @YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx Demo
  42. 42. @YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx And my XML??
  43. 43. @ljacomet#ehcachedvx JSR-107 configuration • Programmatic only • Enter the world of provider extensions • Ehcache 3 expects CacheManager URI to resolve to a configuration file • From there, multiple scenarios are possible
  44. 44. @YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx Demo
  45. 45. Caching in an application
  46. 46. @ljacomet#ehcachedvx public BusinessObject computeAndWin(String param1, String param2) { 
 String key = createKey(param1, param2);
 BusinessObject cachedResult = cache.get(key);
 if (cachedResult == null) {
 cachedResult = loadAndCompute(param1, param2);
 cache.put(key, cachedResult);
 }
 return cachedResult;
 } Cache Aside
  47. 47. @ljacomet#ehcachedvx Cache Aside : not so easy
  48. 48. @ljacomet#ehcachedvx Cache Aside : not so easy • Requires synchronisation between • cache • and system of record
  49. 49. @ljacomet#ehcachedvx Cache Aside : not so easy • Requires synchronisation between • cache • and system of record • JSR-107 has no locking option
  50. 50. @ljacomet#ehcachedvx Cache Aside : not so easy • Requires synchronisation between • cache • and system of record • JSR-107 has no locking option • Potential to be hairy code quite fast
  51. 51. @ljacomet#ehcachedvx Cache Aside: options
  52. 52. @ljacomet#ehcachedvx Cache Aside: options • Rely on the abstraction of your framework • Spring Caching • Hibernate • …
  53. 53. @ljacomet#ehcachedvx Cache Aside: options • Rely on the abstraction of your framework • Spring Caching • Hibernate • … • Alternatives ?
  54. 54. @ljacomet#ehcachedvx public BusinessObject computeAndWin(String param1, String param2) { 
 return cache.get(createKey(param1, param2));
 } Cache Through
  55. 55. @ljacomet#ehcachedvx Cache Through Cache Application code RDBMS
  56. 56. @ljacomet#ehcachedvx Cache Through Cache Application code RDBMS
  57. 57. @ljacomet#ehcachedvx Cache Through Cache Application code RDBMS
  58. 58. @ljacomet#ehcachedvx Cache Through Cache Application code RDBMS
  59. 59. @ljacomet#ehcachedvx Cache Through Cache Application code RDBMS
  60. 60. @ljacomet#ehcachedvx Cache Through
  61. 61. @ljacomet#ehcachedvx Cache Through • get* => CacheLoader • cache miss indicates no data available
  62. 62. @ljacomet#ehcachedvx Cache Through • get* => CacheLoader • cache miss indicates no data available • put* => CacheWriter • Each use means writing to the system of record
  63. 63. @ljacomet#ehcachedvx Cache Through • get* => CacheLoader • cache miss indicates no data available • put* => CacheWriter • Each use means writing to the system of record • Constraints:APIs of CacheLoader / CacheWriter
  64. 64. @ljacomet#ehcachedvx Cache Through : JSR-107
  65. 65. @ljacomet#ehcachedvx Cache Through : JSR-107 • Peculiar behaviours
  66. 66. @ljacomet#ehcachedvx Cache Through : JSR-107 • Peculiar behaviours • putIfAbsent(K key,V value): boolean
  67. 67. @ljacomet#ehcachedvx Cache Through : JSR-107 • Peculiar behaviours • putIfAbsent(K key,V value): boolean • Ignores CacheLoader but not CacheWriter
  68. 68. @ljacomet#ehcachedvx Cache Through : JSR-107 • Peculiar behaviours • putIfAbsent(K key,V value): boolean • Ignores CacheLoader but not CacheWriter • Ehcache 3 allows to tweak this behaviour through configuration
  69. 69. @ljacomet#ehcachedvx Cache Through : JSR-107 • Peculiar behaviours • putIfAbsent(K key,V value): boolean • Ignores CacheLoader but not CacheWriter • Ehcache 3 allows to tweak this behaviour through configuration • Behaviour consistent across atomic operations
  70. 70. @ljacomet#ehcachedvx Cache Through : Write Behind
  71. 71. @ljacomet#ehcachedvx Cache Through : Write Behind • Asynchronous writes to the the system of record • User thread no longer suffers from the latency of the write
  72. 72. @ljacomet#ehcachedvx Cache Through : Write Behind • Asynchronous writes to the the system of record • User thread no longer suffers from the latency of the write • Introduces its own complexities • Write queue: persistent or not? • Mutation guarantee: once and only once? at least once? • What about cache eviction?
  73. 73. Resilience strategy
  74. 74. @ljacomet#ehcachedvx Resilience strategy
  75. 75. @ljacomet#ehcachedvx Resilience strategy • Proposition: “A cache level error should not be the cause for a user level error “
  76. 76. @ljacomet#ehcachedvx Resilience strategy • Proposition: “A cache level error should not be the cause for a user level error “ P.S.This is ongoing development and subject to change
  77. 77. @ljacomet#ehcachedvx Ehcache 3
  78. 78. @ljacomet#ehcachedvx Ehcache 3 • Handle errors internally as much as possible
  79. 79. @ljacomet#ehcachedvx Ehcache 3 • Handle errors internally as much as possible • In memory cache => No exceptions in the execution thread
  80. 80. @ljacomet#ehcachedvx Ehcache 3 • Handle errors internally as much as possible • In memory cache => No exceptions in the execution thread • Default is to log errors, will be configurable / replaceable
  81. 81. @ljacomet#ehcachedvx Ehcache 3 • Handle errors internally as much as possible • In memory cache => No exceptions in the execution thread • Default is to log errors, will be configurable / replaceable • Advanced setups (Distributed + write behind for example)
  82. 82. @ljacomet#ehcachedvx Ehcache 3 • Handle errors internally as much as possible • In memory cache => No exceptions in the execution thread • Default is to log errors, will be configurable / replaceable • Advanced setups (Distributed + write behind for example) • Force user to think about the use cases where the cache can become inconsistent
  83. 83. @ljacomet#ehcachedvx Ehcache 3 • Handle errors internally as much as possible • In memory cache => No exceptions in the execution thread • Default is to log errors, will be configurable / replaceable • Advanced setups (Distributed + write behind for example) • Force user to think about the use cases where the cache can become inconsistent • Will be required to configure a handler for these cases
  84. 84. Ehcache 3 and Terracotta
  85. 85. @ljacomet#ehcachedvx Offheap solution
  86. 86. @ljacomet#ehcachedvx Offheap solution • Solving Garbage Collector pauses on large heaps
  87. 87. @ljacomet#ehcachedvx Offheap solution • Solving Garbage Collector pauses on large heaps • Enables extreme cache scale up • Multi TerraBytes … as long as your server allows it
  88. 88. @ljacomet#ehcachedvx Offheap solution • Solving Garbage Collector pauses on large heaps • Enables extreme cache scale up • Multi TerraBytes … as long as your server allows it • Production tested implementation • 2.0.0 available on GitHub • https://github.com/Terracotta-OSS/offheap-store
  89. 89. @ljacomet#ehcachedvx Clustering solution
  90. 90. @ljacomet#ehcachedvx Clustering solution • Sharing of data across multiple JVMs
  91. 91. @ljacomet#ehcachedvx Clustering solution • Sharing of data across multiple JVMs • Terracotta 4.3.0 again has an OpenSource offering • Integration with Ehcache 2.10.0
  92. 92. @ljacomet#ehcachedvx Clustering solution • Sharing of data across multiple JVMs • Terracotta 4.3.0 again has an OpenSource offering • Integration with Ehcache 2.10.0 • Ehcache 3 will have clustering option in OpenSource • Code starting to appear on GitHub
  93. 93. @YourTwitterHandle@YourTwitterHandle@ljacomet#ehcachedvx Questions ?

×