Terracotta Ehcache ConsistencyStrong and EventualAbhishek SanoujamMarch 29, 2011
Ehcache-2.4 + Terracotta 3.5   Search     –   http://ehcache.org/documentation/search.html   New Consistency modes     –...
Terracotta Ehcache Consistency                 Terracotta Ehcache Consistency   3
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Terracotta Ehcache Consistency   New attribute “consistency” in “terracotta” sub-element of    “cache” in ehcache.xml    ...
Strong Consistency                 Terracotta Ehcache Consistency   4
Strong Consistency   Changes are visible cluster-wide instantly                             Terracotta Ehcache Consistenc...
Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks    – Clustered locks sam...
Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks     – Clustered locks sa...
Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks    – Clustered locks sam...
Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks     – Clustered locks sa...
Eventual Consistency                 Terracotta Ehcache Consistency   5
Eventual Consistency   Changes are visible to other nodes eventually (in order of ms)                                 Ter...
Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys...
Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys...
Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys...
Eventual Consistency   Changes are visible to other nodes eventually (in order of ms)   L2 notifies clients about which ...
Eventual Consistency   Changes are visible to other nodes eventually (in order of ms)   L2 notifies clients about which ...
Eventual Consistency   Changes are visible to other nodes eventually (in order of ms)   L2 notifies clients about which ...
Eventual Consistency   Changes are visible to other nodes eventually (in order of ms)   L2 notifies clients about which ...
Old “coherent” attribute deprecated                  Terracotta Ehcache Consistency   6
Old “coherent” attribute deprecated   Old “coherent” attribute deprecated                           Terracotta Ehcache Co...
Old “coherent” attribute deprecated   Old “coherent” attribute deprecated   coherent=”true” translates to consistency=”s...
Old “coherent” attribute deprecated   Old “coherent” attribute deprecated   coherent=”true” translates to consistency=”s...
Old “coherent” attribute deprecated   Old “coherent” attribute deprecated   coherent=”true” translates to consistency=”s...
Bulk-load mode                 Terracotta Ehcache Consistency   7
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode                                  Terracotta Ehcache...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes          ...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes   Writes...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes Writes a...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes Writes a...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes Writes a...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes Writes a...
Bulk-load mode   coherent=”false” - bulk load mode or incoherent mode   No locks are required for reads/writes Writes a...
How it works - Strong Consistency                 Terracotta Ehcache Consistency   8
How it works - Strong Consistency             Terracotta Server Array (L2)    Node A             Node B                   ...
How it works - Strong Consistency                Terracotta Server Array (L2)    Node A                Node B             ...
How it works - Strong Consistency                  Terracotta Server Array (L2)    acquireLock    (WRITE)    Node A       ...
How it works - Strong Consistency                  Terracotta Server Array (L2)    acquireLock                     grant l...
How it works - Strong Consistency                  Terracotta Server Array (L2)    acquireLock                     grant l...
How it works - Strong Consistency                  Terracotta Server Array (L2)                           (k1, v1 )    acq...
How it works - Strong Consistency                  Terracotta Server Array (L2)                           (k1, v1 )    acq...
How it works - Strong Consistency                  Terracotta Server Array (L2)                           (k1, v1 )    acq...
How it works - Strong Consistency                  Terracotta Server Array (L2)                           (k1, v1 )    acq...
How it works - Strong Consistency                  Terracotta Server Array (L2)                           (k1, v1 )    acq...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                     Terracotta Server Array (L2)                             (k1, v1 )  ...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Strong Consistency                         Terracotta Server Array (L2)                                 (k1...
How it works - Eventual Consistency                 Terracotta Ehcache Consistency   9
How it works - Eventual Consistency             Terracotta Server Array (L2)    Node A             Node B                 ...
How it works - Eventual Consistency                Terracotta Server Array (L2)    Node A                Node B           ...
How it works - Eventual Consistency                  Terracotta Server Array (L2)   put(k1, v1)     Node A                ...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )   put...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )   put...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )   put...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )   put...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )      ...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )      ...
How it works - Eventual Consistency                  Terracotta Server Array (L2)                          (k1, v1 )      ...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v1...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v1...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Eventual Consistency                      Terracotta Server Array (L2)                              (k1, v2...
How it works - Bulk load mode                 Terracotta Ehcache Consistency   10
How it works - Bulk load mode   Similar to eventual consistency     –   No locks required                             Ter...
How it works - Bulk load mode   Similar to eventual consistency     –   No locks required   Puts are batched heavily in ...
How it works - Bulk load mode   Similar to eventual consistency     –   No locks required   Puts are batched heavily in ...
How it works - Bulk load mode   Similar to eventual consistency     –   No locks required   Puts are batched heavily in ...
How it works - Bulk load mode   Similar to eventual consistency     –   No locks required   Puts are batched heavily in ...
Comparison   Strong consistency     – Reads/Writes happen under locks     – Invalidations of local cache happens when a n...
Summary   Strong consistency     –   Pros          • Provides coherent data across the cluster          • Changes visible...
Summary          Terracotta Ehcache Consistency   13
Summary   Eventual Consistency     – Pros        • No need of locks for reads/writes        • Better performance        •...
Summary   Eventual Consistency     – Pros        • No need of locks for reads/writes        • Better performance        •...
Thank you!Abhishek Sanoujamasanoujam@terracottatech.comhttp://terracotta.orghttp://ehcache.orghttp://ehcache.org/documenta...
Upcoming SlideShare
Loading in...5
×

Eventual consistency

1,414

Published on

Slides explaining the consistency modes for Terracotta clustered ehcache.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,414
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Eventual consistency

  1. 1. Terracotta Ehcache ConsistencyStrong and EventualAbhishek SanoujamMarch 29, 2011
  2. 2. Ehcache-2.4 + Terracotta 3.5 Search – http://ehcache.org/documentation/search.html New Consistency modes – http://ehcache.org/documentation/terracotta/ consistency_options.html Nonstop feature – http://ehcache.org/documentation/terracotta/non_stop_cache.html Rejoin Explicit locking api merged to Ehcache interface Various other perf improvements and bug fixes – http://ehcache.org Terracotta Ehcache Consistency 2
  3. 3. Terracotta Ehcache Consistency Terracotta Ehcache Consistency 3
  4. 4. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml Terracotta Ehcache Consistency 3
  5. 5. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml <cache name=”sampleCache”> <terracotta consistency=”strong|eventual” /> </cache> Terracotta Ehcache Consistency 3
  6. 6. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml <cache name=”sampleCache”> <terracotta consistency=”strong|eventual” /> </cache> Consistency can be “strong” or “eventual” Terracotta Ehcache Consistency 3
  7. 7. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml <cache name=”sampleCache”> <terracotta consistency=”strong|eventual” /> </cache> Consistency can be “strong” or “eventual” Old “coherent” attribute deprecated Terracotta Ehcache Consistency 3
  8. 8. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml <cache name=”sampleCache”> <terracotta consistency=”strong|eventual” /> </cache> Consistency can be “strong” or “eventual” Old “coherent” attribute deprecated With “strong” consistency, changes made by any node in the cluster are visible instantly Terracotta Ehcache Consistency 3
  9. 9. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml <cache name=”sampleCache”> <terracotta consistency=”strong|eventual” /> </cache> Consistency can be “strong” or “eventual” Old “coherent” attribute deprecated With “strong” consistency, changes made by any node in the cluster are visible instantly With “eventual” consistency, changes made by any node are visible to other nodes eventually Terracotta Ehcache Consistency 3
  10. 10. Terracotta Ehcache Consistency New attribute “consistency” in “terracotta” sub-element of “cache” in ehcache.xml <cache name=”sampleCache”> <terracotta consistency=”strong|eventual” /> </cache> Consistency can be “strong” or “eventual” Old “coherent” attribute deprecated With “strong” consistency, changes made by any node in the cluster are visible instantly With “eventual” consistency, changes made by any node are visible to other nodes eventually http://ehcache.org/documentation/terracotta/consistency_options.html Terracotta Ehcache Consistency 3
  11. 11. Strong Consistency Terracotta Ehcache Consistency 4
  12. 12. Strong Consistency Changes are visible cluster-wide instantly Terracotta Ehcache Consistency 4
  13. 13. Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks – Clustered locks same as normal read-write locks, but valid through the cluster – Multiple reads possible – Writes are mutually exclusive to other writes and reads Terracotta Ehcache Consistency 4
  14. 14. Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks – Clustered locks same as normal read-write locks, but valid through the cluster – Multiple reads possible – Writes are mutually exclusive to other writes and reads Honors happens-before cluster wide (using clustered locks) Terracotta Ehcache Consistency 4
  15. 15. Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks – Clustered locks same as normal read-write locks, but valid through the cluster – Multiple reads possible – Writes are mutually exclusive to other writes and reads Honors happens-before cluster wide (using clustered locks) Supports other concurrent apis – putIfAbsent(Element element) – removeElement(Element element) – replace(Element element) – replace(Element old, Element element) Terracotta Ehcache Consistency 4
  16. 16. Strong Consistency Changes are visible cluster-wide instantly Reads/Writes uses clustered locks – Clustered locks same as normal read-write locks, but valid through the cluster – Multiple reads possible – Writes are mutually exclusive to other writes and reads Honors happens-before cluster wide (using clustered locks) Supports other concurrent apis – putIfAbsent(Element element) – removeElement(Element element) – replace(Element element) – replace(Element old, Element element) Works with explicit locking apis Terracotta Ehcache Consistency 4
  17. 17. Eventual Consistency Terracotta Ehcache Consistency 5
  18. 18. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) Terracotta Ehcache Consistency 5
  19. 19. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated Terracotta Ehcache Consistency 5
  20. 20. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated On receiving update from L2, those mappings are removed from clients local cache Terracotta Ehcache Consistency 5
  21. 21. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated On receiving update from L2, those mappings are removed from clients local cache Can read stale data for some time (in order of msecs) Terracotta Ehcache Consistency 5
  22. 22. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated On receiving update from L2, those mappings are removed from clients local cache Can read stale data for some time (in order of msecs) Suitable for apps that can tolerate reading stale data Terracotta Ehcache Consistency 5
  23. 23. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated On receiving update from L2, those mappings are removed from clients local cache Can read stale data for some time (in order of msecs) Suitable for apps that can tolerate reading stale data No need of locks for reads/writes – Better performance compared to strong consistency Terracotta Ehcache Consistency 5
  24. 24. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated On receiving update from L2, those mappings are removed from clients local cache Can read stale data for some time (in order of msecs) Suitable for apps that can tolerate reading stale data No need of locks for reads/writes – Better performance compared to strong consistency Supports other concurrent apis – putIfAbsent(Element element) – removeElement(Element element) – replace(Element element) – replace(Element old, Element element) Terracotta Ehcache Consistency 5
  25. 25. Eventual Consistency Changes are visible to other nodes eventually (in order of ms) L2 notifies clients about which keys were updated On receiving update from L2, those mappings are removed from clients local cache Can read stale data for some time (in order of msecs) Suitable for apps that can tolerate reading stale data No need of locks for reads/writes – Better performance compared to strong consistency Supports other concurrent apis – putIfAbsent(Element element) – removeElement(Element element) – replace(Element element) – replace(Element old, Element element) Works with explicit locking apis – provides more control over locking Terracotta Ehcache Consistency 5
  26. 26. Old “coherent” attribute deprecated Terracotta Ehcache Consistency 6
  27. 27. Old “coherent” attribute deprecated Old “coherent” attribute deprecated Terracotta Ehcache Consistency 6
  28. 28. Old “coherent” attribute deprecated Old “coherent” attribute deprecated coherent=”true” translates to consistency=”strong” Terracotta Ehcache Consistency 6
  29. 29. Old “coherent” attribute deprecated Old “coherent” attribute deprecated coherent=”true” translates to consistency=”strong” coherent=”false” translates to consistency=”eventual” Terracotta Ehcache Consistency 6
  30. 30. Old “coherent” attribute deprecated Old “coherent” attribute deprecated coherent=”true” translates to consistency=”strong” coherent=”false” translates to consistency=”eventual” Old coherent=”false” meant bulk-load mode (incoherent mode) – Cannot be set in config (use “eventual” consistency instead) – possible through api only now • setNodeBulkLoadEnabled(true) • setNodeBulkLoadEnabled(false) Terracotta Ehcache Consistency 6
  31. 31. Bulk-load mode Terracotta Ehcache Consistency 7
  32. 32. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode Terracotta Ehcache Consistency 7
  33. 33. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Terracotta Ehcache Consistency 7
  34. 34. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Writes are batched heavily in the client (L1) Terracotta Ehcache Consistency 7
  35. 35. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Writes are batched heavily in the client (L1) Warmup of large caches happens pretty fast Terracotta Ehcache Consistency 7
  36. 36. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Writes are batched heavily in the client (L1) Warmup of large caches happens pretty fast Once values are fetched, changes/updates by other nodes visible after specific time (5 mins by default) Terracotta Ehcache Consistency 7
  37. 37. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Writes are batched heavily in the client (L1) Warmup of large caches happens pretty fast Once values are fetched, changes/updates by other nodes visible after specific time (5 mins by default) Possible through api only Terracotta Ehcache Consistency 7
  38. 38. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Writes are batched heavily in the client (L1) Warmup of large caches happens pretty fast Once values are fetched, changes/updates by other nodes visible after specific time (5 mins by default) Possible through api only Old api’s are deprecated – setNodeCoherent(boolean coherent) – isNodeCoherent() – isClusterCoherent() – waitUntilClusterCoherent() Terracotta Ehcache Consistency 7
  39. 39. Bulk-load mode coherent=”false” - bulk load mode or incoherent mode No locks are required for reads/writes Writes are batched heavily in the client (L1) Warmup of large caches happens pretty fast Once values are fetched, changes/updates by other nodes visible after specific time (5 mins by default) Possible through api only Old api’s are deprecated – setNodeCoherent(boolean coherent) – isNodeCoherent() – isClusterCoherent() – waitUntilClusterCoherent() New api’s added in Ehcache interface: – setNodeBulkLoadEnabled(boolean enabledBulkLoad) – isNodeBulkLoadEnabled() – isClusterBulkLoadEnabled() – waitUntilClusterBulkLoadComplete() Terracotta Ehcache Consistency 7
  40. 40. How it works - Strong Consistency Terracotta Ehcache Consistency 8
  41. 41. How it works - Strong Consistency Terracotta Server Array (L2) Node A Node B Node C (L1) (L1) (L1) Terracotta Ehcache Consistency 8
  42. 42. How it works - Strong Consistency Terracotta Server Array (L2) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 8
  43. 43. How it works - Strong Consistency Terracotta Server Array (L2) acquireLock (WRITE) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 8
  44. 44. How it works - Strong Consistency Terracotta Server Array (L2) acquireLock grant lock (WRITE) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 8
  45. 45. How it works - Strong Consistency Terracotta Server Array (L2) acquireLock grant lock (WRITE) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 8
  46. 46. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 8
  47. 47. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) Terracotta Ehcache Consistency 8
  48. 48. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) Terracotta Ehcache Consistency 8
  49. 49. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  50. 50. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) put(k1, v1) acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  51. 51. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) recall put(k1, v1) acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  52. 52. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant lock (WRITE) recall put(k1, v1) acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  53. 53. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant lock (WRITE) lock recall put(k1, v1) acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  54. 54. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall put(k1, v1) acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  55. 55. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) get(k1) acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  56. 56. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  57. 57. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  58. 58. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  59. 59. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  60. 60. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  61. 61. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  62. 62. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  63. 63. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v1 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  64. 64. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  65. 65. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  66. 66. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  67. 67. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  68. 68. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  69. 69. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  70. 70. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  71. 71. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  72. 72. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) acquireLock (READ) acquireLock recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  73. 73. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 v1 put(k1, v2) acquireLock v2 get(k1) (READ) acquireLock v2recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  74. 74. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 v1 put(k1, v2) acquireLock v2 get(k1) (READ) acquireLock v2recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v2) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  75. 75. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 v1 put(k1, v2) acquireLock v2 get(k1) (READ) acquireLock v2recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v2) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  76. 76. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 v1 put(k1, v2) acquireLock v2 get(k1) (READ) acquireLock v2recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v2) (k1, v2)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 8
  77. 77. How it works - Strong Consistency Terracotta Server Array (L2) (k1, v2 ) acquireLock grant read grant read grant lock lock (WRITE) lock recall get(k1) put(k1, v1) v1 v1 put(k1, v2) acquireLock v2 get(k1) (READ) acquireLock v2recall recall (READ) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v2) (k1, v2)put(k1, v2) put(k1, v1) get(k1) v2 get(k1) v2 Terracotta Ehcache Consistency 8
  78. 78. How it works - Eventual Consistency Terracotta Ehcache Consistency 9
  79. 79. How it works - Eventual Consistency Terracotta Server Array (L2) Node A Node B Node C (L1) (L1) (L1) Terracotta Ehcache Consistency 9
  80. 80. How it works - Eventual Consistency Terracotta Server Array (L2) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 9
  81. 81. How it works - Eventual Consistency Terracotta Server Array (L2) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 9
  82. 82. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) put(k1, v1) Terracotta Ehcache Consistency 9
  83. 83. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) Terracotta Ehcache Consistency 9
  84. 84. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) Terracotta Ehcache Consistency 9
  85. 85. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) put(k1, v1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  86. 86. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) get(k1) put(k1, v1) get(k1) Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  87. 87. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) get(k1) put(k1, v1) v1 get(k1) v1 Node A Node B Node C (L1) (L1) (L1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  88. 88. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) get(k1) put(k1, v1) v1 get(k1) v1 Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  89. 89. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) get(k1) put(k1, v1) v1 get(k1) v1 Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  90. 90. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v1 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  91. 91. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  92. 92. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  93. 93. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  94. 94. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) v1 get(k1) Terracotta Ehcache Consistency 9
  95. 95. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v1) (k1, v1)put(k1, v2) put(k1, v1) get(k1) v1 get(k1) Terracotta Ehcache Consistency 9
  96. 96. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v1) (k1, v1) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  97. 97. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v1) (k1, v1) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  98. 98. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  99. 99. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  100. 100. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  101. 101. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 v2 v2 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  102. 102. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 v2 v2 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v2) (k1, v2) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) Terracotta Ehcache Consistency 9
  103. 103. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 v2 v2 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v2) (k1, v2) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) v2 v2 Terracotta Ehcache Consistency 9
  104. 104. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 v2 v2 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v2) (k1, v2) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) v2 v2 Terracotta Ehcache Consistency 9
  105. 105. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 v2 v2 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v1) (k1, v2) (k1, v2) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) v2 v2 Terracotta Ehcache Consistency 9
  106. 106. How it works - Eventual Consistency Terracotta Server Array (L2) (k1, v2 ) get(k1) put(k1, v1) v1 get(k1) v1 put(k1, v2) k1 k1 v2 v2 Node A Node B Node C (L1) (L1) (L1) (k1, v2) (k1, v2) (k1, v2) v1 v1put(k1, v2) put(k1, v1) get(k1) get(k1) v2 v2 Terracotta Ehcache Consistency 9
  107. 107. How it works - Bulk load mode Terracotta Ehcache Consistency 10
  108. 108. How it works - Bulk load mode Similar to eventual consistency – No locks required Terracotta Ehcache Consistency 10
  109. 109. How it works - Bulk load mode Similar to eventual consistency – No locks required Puts are batched heavily in the L1 Terracotta Ehcache Consistency 10
  110. 110. How it works - Bulk load mode Similar to eventual consistency – No locks required Puts are batched heavily in the L1 The L2 don’t send out invalidation notifications Terracotta Ehcache Consistency 10
  111. 111. How it works - Bulk load mode Similar to eventual consistency – No locks required Puts are batched heavily in the L1 The L2 don’t send out invalidation notifications Invalidations in the local cache happen based on time (5 mins by default) Terracotta Ehcache Consistency 10
  112. 112. How it works - Bulk load mode Similar to eventual consistency – No locks required Puts are batched heavily in the L1 The L2 don’t send out invalidation notifications Invalidations in the local cache happen based on time (5 mins by default) Apps read stale data for the specified time interval – configurable via tc property “ehcache.storageStrategy.dcv2.localcache.incoherentReadTimeout” Terracotta Ehcache Consistency 10
  113. 113. Comparison Strong consistency – Reads/Writes happen under locks – Invalidations of local cache happens when a node acquires WRITE locks Eventual Consistency – Reads/Writes do not require locks – L2 notifies about changes to interested nodes – L1 invalidates local cache upon receiving notification from L2 – Notifications are batched and sent to only interested nodes Bulk-load mode – No locks required – Invalidations happen based on time (5 mins by default) – Puts are batched heavily in the L1 Terracotta Ehcache Consistency 11
  114. 114. Summary Strong consistency – Pros • Provides coherent data across the cluster • Changes visible to all nodes instantly • Honors happens-before cluster wide – Cons • If coherent cache not desired, suffers from performance • Needs locks for both reads and writes • May result in lock hopping when data not partitioned leading to perf degradation Terracotta Ehcache Consistency 12
  115. 115. Summary Terracotta Ehcache Consistency 13
  116. 116. Summary Eventual Consistency – Pros • No need of locks for reads/writes • Better performance • Changes are visible across cluster in order of ms – Cons • Application can read stale data for some time Terracotta Ehcache Consistency 13
  117. 117. Summary Eventual Consistency – Pros • No need of locks for reads/writes • Better performance • Changes are visible across cluster in order of ms – Cons • Application can read stale data for some time Bulk Load mode – Pros • No need of locks for reads/writes • Better performance for puts, useful for cache warmup – Cons • Application can read stale data for longer amount of time • Values once fetched, will see changes after specific amount of time Terracotta Ehcache Consistency 13
  118. 118. Thank you!Abhishek Sanoujamasanoujam@terracottatech.comhttp://terracotta.orghttp://ehcache.orghttp://ehcache.org/documentation/terracotta/consistency_options.html
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×