SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Building Low Latency Java Applications with
Ehcache
Dhruv Kumar
Software Engineer, Terracotta Inc.
Dhruv.Kumar@terracottatech.com
Why In-Memory?
2
3
Data Center Machines
3
4
Data Center Machines
4
5
Data Center Machines
5
6
Memory Capacity Trends
6
7
Disk Capacity Trends
7
8
SSD Capacity Trends
8
9
CPU Speed Trends
9
10
Network I/O Trends
10
11
Memory Throughput Trends
11
12
SSD Throughput Trends
12
13
Disk Throughput Trends
13
14
Trend Summary
14
15
Trend Summary
15
§  Storage is cheap and increases exponentially
§  Most transfer rates increase exponentially except
disk throughput.
–  Gap between disk capacity and transfer rate is increasing
§  Accessing disk is very slow: transferring 100GB
@ 100 MB/s takes 1000s, or approx. 17 minutes.
–  Will get worse, as 512GB/node RAM will be common in 2
years.
–  Faster to access Network Attached Memory!
–  SSDs still not common due to unfavorable price performance
16
In-Memory Computing Opportunity
16
§  256 GB RAM * 4 nodes = 1 TB In-Memory Cluster
§  1 TB can hold many large datasets: 1 billion users
@ 1 KB each
§  Number of CPU cores double every 24 months:
memory/core increases exponentially
§  Bottomline: judiciously using RAM is key.
Ehcache System Architecture
17
18
Terracotta Server Array
Scale with Data and Processing Needs
18
BigMemory
App Server
Ehcache
App Server
Ehcache
Traditional
3-Tier Architecture
Scale Vertically Scale Horizontally
Elastic Scale
In the Cloud
App Server
Ehcache
Quartz
App Server
Ehcache
Quartz
Database
Database
Database
Database
App Server
Ehcache
App Server
Ehcache
BigMemory
Terracotta Server Array
BigMemory
Increase Data in Memory
Reduce Database Reliance
19
Hello Ehcache!
Database
Traditional
3-Tier Architecture
App Server
Ehcache
§  Reduction in database reliance
–  Store repetitively used data and access them
in memory speeds
§  Reduction of new objects created
–  Stored objects will be reused constantly thus
reducing the creation of new objects
§  Less network traffic
–  Stored data is already at the application layer
so no need to make a network call to get it
§  Reduce CPU usage
–  Objects in cache are already in the format you
need for use, no additional marshaling needed.
20
Example Configuration
Configuration via Ehcache.xml
20
Example Configuration
<ehcache>!
!
<cache name=”UserPreferencesCache"!
maxElementsInMemory="10000"!
timeToIdleSeconds="300”!
! ! !memoryStoreEvictionPolicy="LRU”/>!
!
<cache name=”ShoppingCartCache"!
maxElementsInMemory=”2500"!
timeToLiveSeconds=”6000”!
! ! !memoryStoreEvictionPolicy=”LFU"/>!
!
</ehcache>!
20
21
Simple API
21
Example Code
public Object testCache(String key) throws Exception {!
!CacheManager cacheManager = !
! !new CacheManager( “<path to my ehcache.xml>”);!
!Cache myCache = cacheManager.getCache("MyCache");!
!Object value;!
! !!
!Element element = myCache.get(key);!
!if (element == null) {!
! !value = "go get it from somewhere like DB or service,
! ! ! etc";!
! !myCache.put(new Element(key, value));!
!} else {!
! !value = (Object) element.getValue();!
!}!
! !!
!return value;!
}!
22
Ehcache Search
§  Intuitive, full-featured Search API
§  Fast, efficient implementation
§  Make cache searchable, then specify attributes
22
<cache name=”peopleCache”>
<searchable>
<searchAttribute name="age" expression="value.getAge()"/>
<searchAttribute name="gender" expression="value.getGender()"/>
</searchable>
</cache>
Example: Search for 32-year-old males
results = cache.createQuery().includeKeys()
.addCriteria(age.eq(32)).and (gender.eq("male"))
.execute();
Example Configuration and Code
23
Ehcache Search Using SQL-like Syntax
§  Can also search Ehcache using a SQL like syntax
§  String Queries mapped to Ehcache Search API
23
Example: Search for 32-year-old males
results = cache.createQuery().includeKeys()
.addCriteria(age.eq(32)).and (gender.eq("male"))
.execute();
// or using Ehcache Query Language
QueryManager qm = (new QueryManagerBuilder()).addEhcache(peopleCache).build();
String statement = “select age, gender from peopleCache
where age = 32 and gender =‘male’;”
results = qm.createQuery(statement).end().execute();
Example Configuration and Code
24
Ehcache Persistence
§  Persist actions in a log-append store (Fast Restart Store).
§  Each mutate operation is recorded. Optionally synchronous.
§  On restart, Ehcache entries and Index data are reconstructed from the
log.
24
Example ConfigurationExample Configuration
<ehcache>!
<cache name=”UserPreferencesCache"!
maxElementsInMemory="10000"!
timeToIdleSeconds="300”!
! ! persistenceStrategy=“localRestartable”>!
</ehcache>!
25
In-memory Data and Speed
25
Milliseconds
App Response Time
Microseconds
App Response Time
Memory
90% of Data in
Database
Database
90% of Data in
Memory
26
Storing Data away from Java Heap
(BigMemory)
Off-heap memory allocator. Uses NIO
DirectByteBuffers.
Bypasses Java Garbage Collection.
Only Serializable keys and values can be
placed in Off-heap.
Pure Java implementation compatible with
all popular JVMs
Requires no changes to application code,
JVM or OS
26
Database
Vertical Scaling
App Server
Ehcache
BigMemory
27
BigMemory Configuration
<ehcache>
<cache name= UserPreferencesCache"
maxBytesOnHeap=”512M"
timeToIdleSeconds="300
!memoryStoreEvictionPolicy="LRU
!overflowToOffHeap="true
! !maxBytesOffHeap= 30G"/>
<cache name= ShoppingCartCache"
maxElementsInMemory= 2500"
timeToLiveSeconds= 6000
!memoryStoreEvictionPolicy="LFU"/>
</ehcache>!
27
Example Configuration
28
Testing Offheap Performance
28
• Public URL:
http://svn.terracotta.org/svn/forge/offHeap-test/
• Our Configuration: Six 4-core Xeon CPUs @ 2.93
GHz, 128 GB RAM, RHEL 5.1, Sun JDK 1.6.0_21
in 64 bit mode.
• Load the cache and then run 50 threads doing
90% Read (get() call) calls and 10 % Writes (put()
call)
• Run in Heap and Offheap, and compare GC
duration, latency, throughput.
29
Offheap Perf Test: Garbage Collection Pauses
29
30
Offheap Perf Test: Maximum Latency
30
31
Offheap Perf Test: Mean Latency
31
Distributed
Ehcache
32
3333
Distributed Applications
Consistency?
3434
Distributed Ehcache using Terracotta Server
Array
§  Stateful Server Array
§  Synchronous TCP based connections to
clients
§  Highly Available using Master Slave
replication
§  Linear Scale Out Characteristics
§  Persistent
§  Various consistency optionsDatabase
Scale Out
App Server
Ehcache
Terracotta Server Array
BigMemory
App Server
Ehcache
35
Terracotta Server Array
35
Terracotta
ServerArray
Stripe
Pure Java
cache server on
commodity HW
Transactional
updated mirror for
high availability
Stripe
Commodity Server
Application
Terracotta Driver
Stripe Stripe Stripe Stripe
Commodity Server
Application
Terracotta Driver
Commodity Server
Application
Terracotta Driver
TCP
§ Durability
§ Mirroring
§ Striping
§ Developer Console
§ Plug-in Monitoring
§ Operations Center
Commodity Server
Disk
Active
Server
Commodity Server
Disk
BigMemory
Mirror
BigMemory
36
Example Configuration
Configuring Ehcache to use Terracotta
36
<ehcache>
!<terracottaConfig url="someserver:9510"/>
!<cache name= UserPreferencesCache
! !maxElementsInMemory="10000
! !timeToIdleSeconds= 300 />
!<cache name= ShoppingCartCache"
! !maxElementsInMemory= 25000"
! !timeToLiveSeconds= 6000 />!
!<terracotta />
</ehcache>!
Simply change two lines of configuration
37
Tiered Storage
In-Memory
Tiered Data Storage
37
Terracotta Heap
Heap
Store
BigMemory
Off-Heap Store
2,000,000+
1,000,000
100,000
2
1,000
10,000+
Speed (TPS)
1,000s
Size (GB)
External Data Source
(e.g., Database)
Terracotta Offheap
38
Example Configuration
Consistency options in TSA
38
Strongly
Consistent
Fully
Transactional
Eventually
Consistent
More Consistency More Performance
<cache name=”UserPreferencesCache"
maxElementsInMemory="10000"
timeToLiveSeconds="300”>
<terracotta consistency=”eventual"/>
</cache>
<cache name=”ShoppingCartCache"
maxElementsInMemory=”5000"
timeToIdleSeconds=”6000”>
<terracotta consistency=”strong"/>
</cache>
Example Configuration
39
Terracotta Server Array
Scale with Data and Processing Needs
39
BigMemory
App Server
Ehcache
App Server
Ehcache
Traditional
3-Tier Architecture
Scale Up Scale Out
Elastic Scale
In the Cloud
App Server
Ehcache
Quartz
App Server
Ehcache
Quartz
Database
Database
Database
Database
App Server
Ehcache
App Server
Ehcache
BigMemory
Terracotta Server Array
BigMemory
Increase Data in Memory
Reduce Database Reliance
40
Recent Developments
40
• JSR107
• Hadoop Integration: One way
(EhcacheOutputFormat)
• New Management and Monitoring
4141
Thank You
Dhruv.Kumar@terracottatech.com

Weitere ähnliche Inhalte

Was ist angesagt?

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparisonRohit Kelapure
 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web CacheProdigyView
 
Distributed caching with java JCache
Distributed caching with java JCacheDistributed caching with java JCache
Distributed caching with java JCacheKasun Gajasinghe
 
World Wide Web Caching
World Wide Web CachingWorld Wide Web Caching
World Wide Web Cachingersanbilik
 
Web session replication with Hazelcast
Web session replication with HazelcastWeb session replication with Hazelcast
Web session replication with HazelcastEmrah Kocaman
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...elliando dias
 
Session Handling Using Memcache
Session Handling Using MemcacheSession Handling Using Memcache
Session Handling Using MemcacheAnand Ghaywankar
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching SolutionsITviec
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best PracticesRatnesh kumar, CSM
 
Using memcache to improve php performance
Using memcache to improve php performanceUsing memcache to improve php performance
Using memcache to improve php performanceSudar Muthu
 
Skalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.comSkalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.comSpodek 2.0
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedGear6
 
Share point 2013 distributed cache
Share point 2013 distributed cacheShare point 2013 distributed cache
Share point 2013 distributed cacheMichael Nokhamzon
 
캐시 분산처리 인프라
캐시 분산처리 인프라캐시 분산처리 인프라
캐시 분산처리 인프라Park Chunduck
 
Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached PresentationAsif Ali
 

Was ist angesagt? (20)

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
 
JCache Using JCache
JCache Using JCacheJCache Using JCache
JCache Using JCache
 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
 
Distributed caching with java JCache
Distributed caching with java JCacheDistributed caching with java JCache
Distributed caching with java JCache
 
World Wide Web Caching
World Wide Web CachingWorld Wide Web Caching
World Wide Web Caching
 
Eh cache in Kaunas JUG
Eh cache in Kaunas JUGEh cache in Kaunas JUG
Eh cache in Kaunas JUG
 
Web session replication with Hazelcast
Web session replication with HazelcastWeb session replication with Hazelcast
Web session replication with Hazelcast
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
 
Caching
CachingCaching
Caching
 
Session Handling Using Memcache
Session Handling Using MemcacheSession Handling Using Memcache
Session Handling Using Memcache
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 
Using memcache to improve php performance
Using memcache to improve php performanceUsing memcache to improve php performance
Using memcache to improve php performance
 
Skalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.comSkalowalna architektura na przykładzie soccerway.com
Skalowalna architektura na przykładzie soccerway.com
 
Cassandra as Memcache
Cassandra as MemcacheCassandra as Memcache
Cassandra as Memcache
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
 
Share point 2013 distributed cache
Share point 2013 distributed cacheShare point 2013 distributed cache
Share point 2013 distributed cache
 
캐시 분산처리 인프라
캐시 분산처리 인프라캐시 분산처리 인프라
캐시 분산처리 인프라
 
Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached Presentation
 

Andere mochten auch

Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Predicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience ReportPredicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience Reporttilman.holschuh
 
SAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss TechnologiesSAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss Technologieshwilming
 
The new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spiThe new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spiCyril Lakech
 
Intro To Sap Netweaver Java
Intro To Sap Netweaver JavaIntro To Sap Netweaver Java
Intro To Sap Netweaver JavaLeland Bartlett
 
Practical SAP pentesting workshop (NullCon Goa)
Practical SAP pentesting workshop (NullCon Goa)Practical SAP pentesting workshop (NullCon Goa)
Practical SAP pentesting workshop (NullCon Goa)ERPScan
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012hwilming
 
Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java appsSimon Ritter
 
Sap java connector / Hybris RFC
Sap java connector / Hybris RFCSap java connector / Hybris RFC
Sap java connector / Hybris RFCMonsif Elaissoussi
 
Spcd hs batch 87 foundation
Spcd hs batch 87 foundationSpcd hs batch 87 foundation
Spcd hs batch 87 foundationEd Kissyou
 
0721
07210721
0721wzsse
 
Ethnic Politics and the 2015 Elections in Myanmar
Ethnic Politics and the 2015 Elections in MyanmarEthnic Politics and the 2015 Elections in Myanmar
Ethnic Politics and the 2015 Elections in MyanmarMYO AUNG Myanmar
 
The Layout of iMovie
The Layout of iMovieThe Layout of iMovie
The Layout of iMovieDawn Anthony
 
Resultados Reunión N16
Resultados Reunión N16Resultados Reunión N16
Resultados Reunión N16lucasmustaine
 
Ibne maryam - ابن مریم
Ibne maryam - ابن مریمIbne maryam - ابن مریم
Ibne maryam - ابن مریمmuzaffertahir9
 
Databazove systemy6
Databazove systemy6Databazove systemy6
Databazove systemy6olc_user
 

Andere mochten auch (20)

SAP and Red Hat JBoss Partner Webinar
SAP and Red Hat JBoss Partner WebinarSAP and Red Hat JBoss Partner Webinar
SAP and Red Hat JBoss Partner Webinar
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Predicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience ReportPredicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience Report
 
Sap java
Sap javaSap java
Sap java
 
SAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss TechnologiesSAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss Technologies
 
The new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spiThe new ehcache 2.0 and hibernate spi
The new ehcache 2.0 and hibernate spi
 
Intro To Sap Netweaver Java
Intro To Sap Netweaver JavaIntro To Sap Netweaver Java
Intro To Sap Netweaver Java
 
Practical SAP pentesting workshop (NullCon Goa)
Practical SAP pentesting workshop (NullCon Goa)Practical SAP pentesting workshop (NullCon Goa)
Practical SAP pentesting workshop (NullCon Goa)
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012
 
Low latency Java apps
Low latency Java appsLow latency Java apps
Low latency Java apps
 
Sap java connector / Hybris RFC
Sap java connector / Hybris RFCSap java connector / Hybris RFC
Sap java connector / Hybris RFC
 
Spcd hs batch 87 foundation
Spcd hs batch 87 foundationSpcd hs batch 87 foundation
Spcd hs batch 87 foundation
 
DGAE
DGAEDGAE
DGAE
 
0721
07210721
0721
 
Modul lengkap
Modul lengkapModul lengkap
Modul lengkap
 
Ethnic Politics and the 2015 Elections in Myanmar
Ethnic Politics and the 2015 Elections in MyanmarEthnic Politics and the 2015 Elections in Myanmar
Ethnic Politics and the 2015 Elections in Myanmar
 
The Layout of iMovie
The Layout of iMovieThe Layout of iMovie
The Layout of iMovie
 
Resultados Reunión N16
Resultados Reunión N16Resultados Reunión N16
Resultados Reunión N16
 
Ibne maryam - ابن مریم
Ibne maryam - ابن مریمIbne maryam - ابن مریم
Ibne maryam - ابن مریم
 
Databazove systemy6
Databazove systemy6Databazove systemy6
Databazove systemy6
 

Ähnlich wie Building low latency java applications with ehcache

Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Shailendra Prasad
 
Scaling Your Cache
Scaling Your CacheScaling Your Cache
Scaling Your CacheAlex Miller
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cacheMarc Cortinas Val
 
Optimizing elastic search on google compute engine
Optimizing elastic search on google compute engineOptimizing elastic search on google compute engine
Optimizing elastic search on google compute engineBhuvaneshwaran R
 
Running ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionRunning ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionSearce Inc
 
VMworld 2014: Virtualizing Databases
VMworld 2014: Virtualizing DatabasesVMworld 2014: Virtualizing Databases
VMworld 2014: Virtualizing DatabasesVMworld
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012eballisty
 
Zend Server Data Caching
Zend Server Data CachingZend Server Data Caching
Zend Server Data CachingEl Taller Web
 
VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Wim Godden
 
Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Louis Jacomet
 
VMworld 2013: Extreme Performance Series: Storage in a Flash
VMworld 2013: Extreme Performance Series: Storage in a Flash VMworld 2013: Extreme Performance Series: Storage in a Flash
VMworld 2013: Extreme Performance Series: Storage in a Flash VMworld
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheColdFusionConference
 
High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web SitesRavi Raj
 
Rails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeRails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeFastly
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeMichael May
 
Tuning Your SharePoint Environment
Tuning Your SharePoint EnvironmentTuning Your SharePoint Environment
Tuning Your SharePoint Environmentvmaximiuk
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)Michael Collier
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on SteroidsSiteGround.com
 

Ähnlich wie Building low latency java applications with ehcache (20)

Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
 
Scaling Your Cache
Scaling Your CacheScaling Your Cache
Scaling Your Cache
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 
Optimizing elastic search on google compute engine
Optimizing elastic search on google compute engineOptimizing elastic search on google compute engine
Optimizing elastic search on google compute engine
 
Running ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionRunning ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in Production
 
Cache is King
Cache is KingCache is King
Cache is King
 
VMworld 2014: Virtualizing Databases
VMworld 2014: Virtualizing DatabasesVMworld 2014: Virtualizing Databases
VMworld 2014: Virtualizing Databases
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012
 
Zend Server Data Caching
Zend Server Data CachingZend Server Data Caching
Zend Server Data Caching
 
VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3
 
VMworld 2013: Extreme Performance Series: Storage in a Flash
VMworld 2013: Extreme Performance Series: Storage in a Flash VMworld 2013: Extreme Performance Series: Storage in a Flash
VMworld 2013: Extreme Performance Series: Storage in a Flash
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
 
High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web Sites
 
Rails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeRails Caching: Secrets From the Edge
Rails Caching: Secrets From the Edge
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
 
Tuning Your SharePoint Environment
Tuning Your SharePoint EnvironmentTuning Your SharePoint Environment
Tuning Your SharePoint Environment
 
More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)More Cache for Less Cash (DevLink 2014)
More Cache for Less Cash (DevLink 2014)
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 

Mehr von Chris Westin

Data torrent meetup-productioneng
Data torrent meetup-productionengData torrent meetup-productioneng
Data torrent meetup-productionengChris Westin
 
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalAmbari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalChris Westin
 
Cluster management and automation with cloudera manager
Cluster management and automation with cloudera managerCluster management and automation with cloudera manager
Cluster management and automation with cloudera managerChris Westin
 
SDN/OpenFlow #lspe
SDN/OpenFlow #lspeSDN/OpenFlow #lspe
SDN/OpenFlow #lspeChris Westin
 
cfengine3 at #lspe
cfengine3 at #lspecfengine3 at #lspe
cfengine3 at #lspeChris Westin
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012Chris Westin
 
Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Chris Westin
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012Chris Westin
 
Stingray - Riverbed Technology
Stingray - Riverbed TechnologyStingray - Riverbed Technology
Stingray - Riverbed TechnologyChris Westin
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica setsChris Westin
 
Architecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionArchitecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionChris Westin
 
MongoDB: An Introduction - July 2011
MongoDB:  An Introduction - July 2011MongoDB:  An Introduction - July 2011
MongoDB: An Introduction - July 2011Chris Westin
 
Practical Replication June-2011
Practical Replication June-2011Practical Replication June-2011
Practical Replication June-2011Chris Westin
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011Chris Westin
 
Ganglia Overview-v2
Ganglia Overview-v2Ganglia Overview-v2
Ganglia Overview-v2Chris Westin
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011Chris Westin
 

Mehr von Chris Westin (20)

Data torrent meetup-productioneng
Data torrent meetup-productionengData torrent meetup-productioneng
Data torrent meetup-productioneng
 
Gripshort
GripshortGripshort
Gripshort
 
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalAmbari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.final
 
Cluster management and automation with cloudera manager
Cluster management and automation with cloudera managerCluster management and automation with cloudera manager
Cluster management and automation with cloudera manager
 
SDN/OpenFlow #lspe
SDN/OpenFlow #lspeSDN/OpenFlow #lspe
SDN/OpenFlow #lspe
 
cfengine3 at #lspe
cfengine3 at #lspecfengine3 at #lspe
cfengine3 at #lspe
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012
 
Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
 
Stingray - Riverbed Technology
Stingray - Riverbed TechnologyStingray - Riverbed Technology
Stingray - Riverbed Technology
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica sets
 
Architecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionArchitecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage Solution
 
FlashCache
FlashCacheFlashCache
FlashCache
 
Large Scale Cacti
Large Scale CactiLarge Scale Cacti
Large Scale Cacti
 
MongoDB: An Introduction - July 2011
MongoDB:  An Introduction - July 2011MongoDB:  An Introduction - July 2011
MongoDB: An Introduction - July 2011
 
Practical Replication June-2011
Practical Replication June-2011Practical Replication June-2011
Practical Replication June-2011
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
Ganglia Overview-v2
Ganglia Overview-v2Ganglia Overview-v2
Ganglia Overview-v2
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
 

Kürzlich hochgeladen

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Building low latency java applications with ehcache

  • 1. Building Low Latency Java Applications with Ehcache Dhruv Kumar Software Engineer, Terracotta Inc. Dhruv.Kumar@terracottatech.com
  • 15. 15 Trend Summary 15 §  Storage is cheap and increases exponentially §  Most transfer rates increase exponentially except disk throughput. –  Gap between disk capacity and transfer rate is increasing §  Accessing disk is very slow: transferring 100GB @ 100 MB/s takes 1000s, or approx. 17 minutes. –  Will get worse, as 512GB/node RAM will be common in 2 years. –  Faster to access Network Attached Memory! –  SSDs still not common due to unfavorable price performance
  • 16. 16 In-Memory Computing Opportunity 16 §  256 GB RAM * 4 nodes = 1 TB In-Memory Cluster §  1 TB can hold many large datasets: 1 billion users @ 1 KB each §  Number of CPU cores double every 24 months: memory/core increases exponentially §  Bottomline: judiciously using RAM is key.
  • 18. 18 Terracotta Server Array Scale with Data and Processing Needs 18 BigMemory App Server Ehcache App Server Ehcache Traditional 3-Tier Architecture Scale Vertically Scale Horizontally Elastic Scale In the Cloud App Server Ehcache Quartz App Server Ehcache Quartz Database Database Database Database App Server Ehcache App Server Ehcache BigMemory Terracotta Server Array BigMemory Increase Data in Memory Reduce Database Reliance
  • 19. 19 Hello Ehcache! Database Traditional 3-Tier Architecture App Server Ehcache §  Reduction in database reliance –  Store repetitively used data and access them in memory speeds §  Reduction of new objects created –  Stored objects will be reused constantly thus reducing the creation of new objects §  Less network traffic –  Stored data is already at the application layer so no need to make a network call to get it §  Reduce CPU usage –  Objects in cache are already in the format you need for use, no additional marshaling needed.
  • 20. 20 Example Configuration Configuration via Ehcache.xml 20 Example Configuration <ehcache>! ! <cache name=”UserPreferencesCache"! maxElementsInMemory="10000"! timeToIdleSeconds="300”! ! ! !memoryStoreEvictionPolicy="LRU”/>! ! <cache name=”ShoppingCartCache"! maxElementsInMemory=”2500"! timeToLiveSeconds=”6000”! ! ! !memoryStoreEvictionPolicy=”LFU"/>! ! </ehcache>! 20
  • 21. 21 Simple API 21 Example Code public Object testCache(String key) throws Exception {! !CacheManager cacheManager = ! ! !new CacheManager( “<path to my ehcache.xml>”);! !Cache myCache = cacheManager.getCache("MyCache");! !Object value;! ! !! !Element element = myCache.get(key);! !if (element == null) {! ! !value = "go get it from somewhere like DB or service, ! ! ! etc";! ! !myCache.put(new Element(key, value));! !} else {! ! !value = (Object) element.getValue();! !}! ! !! !return value;! }!
  • 22. 22 Ehcache Search §  Intuitive, full-featured Search API §  Fast, efficient implementation §  Make cache searchable, then specify attributes 22 <cache name=”peopleCache”> <searchable> <searchAttribute name="age" expression="value.getAge()"/> <searchAttribute name="gender" expression="value.getGender()"/> </searchable> </cache> Example: Search for 32-year-old males results = cache.createQuery().includeKeys() .addCriteria(age.eq(32)).and (gender.eq("male")) .execute(); Example Configuration and Code
  • 23. 23 Ehcache Search Using SQL-like Syntax §  Can also search Ehcache using a SQL like syntax §  String Queries mapped to Ehcache Search API 23 Example: Search for 32-year-old males results = cache.createQuery().includeKeys() .addCriteria(age.eq(32)).and (gender.eq("male")) .execute(); // or using Ehcache Query Language QueryManager qm = (new QueryManagerBuilder()).addEhcache(peopleCache).build(); String statement = “select age, gender from peopleCache where age = 32 and gender =‘male’;” results = qm.createQuery(statement).end().execute(); Example Configuration and Code
  • 24. 24 Ehcache Persistence §  Persist actions in a log-append store (Fast Restart Store). §  Each mutate operation is recorded. Optionally synchronous. §  On restart, Ehcache entries and Index data are reconstructed from the log. 24 Example ConfigurationExample Configuration <ehcache>! <cache name=”UserPreferencesCache"! maxElementsInMemory="10000"! timeToIdleSeconds="300”! ! ! persistenceStrategy=“localRestartable”>! </ehcache>!
  • 25. 25 In-memory Data and Speed 25 Milliseconds App Response Time Microseconds App Response Time Memory 90% of Data in Database Database 90% of Data in Memory
  • 26. 26 Storing Data away from Java Heap (BigMemory) Off-heap memory allocator. Uses NIO DirectByteBuffers. Bypasses Java Garbage Collection. Only Serializable keys and values can be placed in Off-heap. Pure Java implementation compatible with all popular JVMs Requires no changes to application code, JVM or OS 26 Database Vertical Scaling App Server Ehcache BigMemory
  • 27. 27 BigMemory Configuration <ehcache> <cache name= UserPreferencesCache" maxBytesOnHeap=”512M" timeToIdleSeconds="300 !memoryStoreEvictionPolicy="LRU !overflowToOffHeap="true ! !maxBytesOffHeap= 30G"/> <cache name= ShoppingCartCache" maxElementsInMemory= 2500" timeToLiveSeconds= 6000 !memoryStoreEvictionPolicy="LFU"/> </ehcache>! 27 Example Configuration
  • 28. 28 Testing Offheap Performance 28 • Public URL: http://svn.terracotta.org/svn/forge/offHeap-test/ • Our Configuration: Six 4-core Xeon CPUs @ 2.93 GHz, 128 GB RAM, RHEL 5.1, Sun JDK 1.6.0_21 in 64 bit mode. • Load the cache and then run 50 threads doing 90% Read (get() call) calls and 10 % Writes (put() call) • Run in Heap and Offheap, and compare GC duration, latency, throughput.
  • 29. 29 Offheap Perf Test: Garbage Collection Pauses 29
  • 30. 30 Offheap Perf Test: Maximum Latency 30
  • 31. 31 Offheap Perf Test: Mean Latency 31
  • 34. 3434 Distributed Ehcache using Terracotta Server Array §  Stateful Server Array §  Synchronous TCP based connections to clients §  Highly Available using Master Slave replication §  Linear Scale Out Characteristics §  Persistent §  Various consistency optionsDatabase Scale Out App Server Ehcache Terracotta Server Array BigMemory App Server Ehcache
  • 35. 35 Terracotta Server Array 35 Terracotta ServerArray Stripe Pure Java cache server on commodity HW Transactional updated mirror for high availability Stripe Commodity Server Application Terracotta Driver Stripe Stripe Stripe Stripe Commodity Server Application Terracotta Driver Commodity Server Application Terracotta Driver TCP § Durability § Mirroring § Striping § Developer Console § Plug-in Monitoring § Operations Center Commodity Server Disk Active Server Commodity Server Disk BigMemory Mirror BigMemory
  • 36. 36 Example Configuration Configuring Ehcache to use Terracotta 36 <ehcache> !<terracottaConfig url="someserver:9510"/> !<cache name= UserPreferencesCache ! !maxElementsInMemory="10000 ! !timeToIdleSeconds= 300 /> !<cache name= ShoppingCartCache" ! !maxElementsInMemory= 25000" ! !timeToLiveSeconds= 6000 />! !<terracotta /> </ehcache>! Simply change two lines of configuration
  • 37. 37 Tiered Storage In-Memory Tiered Data Storage 37 Terracotta Heap Heap Store BigMemory Off-Heap Store 2,000,000+ 1,000,000 100,000 2 1,000 10,000+ Speed (TPS) 1,000s Size (GB) External Data Source (e.g., Database) Terracotta Offheap
  • 38. 38 Example Configuration Consistency options in TSA 38 Strongly Consistent Fully Transactional Eventually Consistent More Consistency More Performance <cache name=”UserPreferencesCache" maxElementsInMemory="10000" timeToLiveSeconds="300”> <terracotta consistency=”eventual"/> </cache> <cache name=”ShoppingCartCache" maxElementsInMemory=”5000" timeToIdleSeconds=”6000”> <terracotta consistency=”strong"/> </cache> Example Configuration
  • 39. 39 Terracotta Server Array Scale with Data and Processing Needs 39 BigMemory App Server Ehcache App Server Ehcache Traditional 3-Tier Architecture Scale Up Scale Out Elastic Scale In the Cloud App Server Ehcache Quartz App Server Ehcache Quartz Database Database Database Database App Server Ehcache App Server Ehcache BigMemory Terracotta Server Array BigMemory Increase Data in Memory Reduce Database Reliance
  • 40. 40 Recent Developments 40 • JSR107 • Hadoop Integration: One way (EhcacheOutputFormat) • New Management and Monitoring