Eh cache in Kaunas JUG

720 views

Published on

Saulius Tvarijonas presented EhCach

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

No Downloads
Views
Total views
720
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Eh cache in Kaunas JUG

  1. 1. EhCache To Cache Or Not To Cache? Kaunas JUG Saulius Tvarijonas · saulius.tvarijonas@gmail.com
  2. 2. Wiki ● Ehcache is a widely used open source Java distributed cache for general purpose caching, Java EE and light- weight containers ● Ehcache was originally developed by Greg Luck, starting in 2003. In 2009, the project was purchased by Terracotta
  3. 3. Will an Application Benefit from Caching?
  4. 4. Will an Application Benefit from Caching? ● Speeding up CPU-bound Applications ● Speeding up I/O-bound Applications ● Increased Application Scalability
  5. 5. Scaling
  6. 6. Topologies ● Standalone ● Distributed ● Replicated
  7. 7. Storage Options ● MemoryStore ● Off-HeapStore ● DiskStore
  8. 8. Cache Usage Patterns ● cache-aside (or direct manipulation) ● cache-as-sor (a combination of read-through and write-x patterns) ● read-through ● write-through ● write-behind (or write-back) ● copy-cache
  9. 9. Cache Sizing ● Bytes (maxBytesLocalHeap=”30M”) ● Count (maxEntriesLocalHeap) ● Percentage (maxBytesLocalHeap="40%")
  10. 10. Eviction ● Time To Live ● Time To Idle ● Eternal ● Pinning ● Overflow ● memoryStoreEvictionPolicy
  11. 11. Cache Persistence <cache> <persistence strategy=”localRestartable|localTempSwap|none|distributed” synchronousWrites=”false|true”/> </cache>
  12. 12. Search
  13. 13. Replication
  14. 14. Replication ● RMI, JGroups, JMS ● Serialization of key at least required ● Automatic Peer Discovery (Multicast) ● Bootstrap ● Sync and ASync ● Puts, Updates, Removals, UpdatesViaCopy
  15. 15. WAN Replication
  16. 16. BigMemory Max
  17. 17. BigMemory Max ● Persistent Application State ● High Availability ● Fast Restartability ● Scalability ● Search
  18. 18. Products
  19. 19. JSR 107 Java Caching Standard ● javax.cache.Cache ● Java 6 required ● Included in Java 7 EE
  20. 20. Web Console
  21. 21. Web Console ● Real Time Statistics ● Live Configuration Updates ● Cache enable/disable/clear ● Charts
  22. 22. Test Storage Results Type Total time (Concurrent)HashMap 11ms MemoryStore 39ms Off-HeapStore 5800ms DiskStore 11300ms ● Cache with 1k elements ● Element size 500 bytes ● Measuring getFromCache time (100k times)
  23. 23. EhCache 3.0 ● Standard API JSR 107 ● Generics, Java 8 ready ● Java 6 compatible ● Better configuration
  24. 24. Competitors ● Hazelcast ● Memcached ● Oracle Coherence ● Infinispan ● GemFire ● GridGain
  25. 25. Java Forever Thank You!

×