Developing High Performance and Scalable ColdFusion Applications Using Terracotta Ehcache

  • Published on
    13-Apr-2017

  • View
    72

  • Download
    1

Transcript

<ul><li><p>ColdFusion Summit 2016</p></li><li><p>Developing High Performance and Scalable ColdFusion Applications </p><p>Using Terracotta Ehcache</p><p>By: Shailen Prasad</p><p>Product Management &amp; Strategy</p><p>In-Memory Computing</p><p>Software AG USA, Inc.</p></li><li><p>What is this?</p><p>Growth will happen when efficiency increases. Plow did what </p><p>"In-Memory computing is doing to the human race today"</p></li><li><p>Why you (and I) are here ?</p></li><li><p>What will be covered in this presentation?</p><p> How to scale options (pros and cons)</p><p> Caching basics (various options available)</p><p> Recent updates of Open source Ehcache project.</p><p> Ehcache, Terracotta OSS and BigMemory</p><p> The benefits of distributed caching for building applications where latency and performance is </p><p>crucial. </p><p> Advance caching techniques for scaling your current CF application using Terracotta distribution </p><p>caching (BigMemory)</p><p> To conclude, highlights on some customer use cases where caching was mission critical</p><p>In-Memory caching and data management is becoming mainstream for accelerating </p><p>business applications. This session will introduce :</p></li><li><p>SCALE OUT</p><p>SCA</p><p>LE U</p><p>P</p><p>Scale your existing applicationAlso knowns as Vertical Scaling</p><p> Pros:</p><p> Less power consumption than running multiple servers</p><p> Generally less challenging to implement</p><p> Less licensing costs Cons:</p><p> $$$ VERY EXPENSIVE Greater risk of hardware failure </p><p>causing bigger outages</p><p> Generally severe vendor lock-in and limited upgradeability in the </p><p>future.</p><p>Also knowns as Horizontal Scaling</p><p> Pros:</p><p> $ Much cheaper than scaling vertically</p><p> Easier to run fault-tolerance Generally easier to upgrade</p><p> Cons:</p><p> Bigger datacenter foot print Higher power consumptions Possibly more network resource </p><p>dependency</p><p>Ad</p><p>din</p><p>g m</p><p>ore</p><p> RA</p><p>M/C</p><p>PU</p><p>Adding more machines</p></li><li><p>In-Memory Caching In a nutshell</p><p>On Heap Cache (also known as In-Process Cache) or L1 cache</p><p>ColdFusion Application</p><p>CF Internals</p><p>On Heap </p><p>Cache</p><p>JVM</p><p> Fastest among all other caching tier </p><p> Doesnt require marshalling and un-marshalling of the data</p><p> Limited by Max JVM heap size (limited on 32 bit systems)</p><p> Garbage collection still remains the challenge</p></li><li><p>Caching In a nutshell</p><p>Local Off Heap Cache (in-process caching) or L1 cache</p><p>ColdFusion Application</p><p>CF Internals</p><p>Local On-heap </p><p>Cache</p><p>JVM</p><p>Local Off-heap Cache</p><p>Direct memory buffers</p><p> Access Memory outside of Application heap </p><p> Can Scale as it is not limited by JVM heap size even on a 32 bit machine</p><p> Application doesnt have to worry about Garbage collection for the data stored in off-heap</p><p> Slower than on-heap cache, entries has to serialized and de-serialized.</p></li><li><p>JVM</p><p>Local Off-heap Cache</p><p>Caching In a nutshell</p><p>Distributed Off Heap Cache (also known as Out-of-Process </p><p>Cache) or L2 cacheColdFusion </p><p>Application</p><p>CF Internals</p><p>Local On-heap </p><p>Cache</p><p>JVM</p><p>L1Off-heap Cache</p><p>JVM</p><p>L2 Off-heap Cache Runs outside of the Application Server JVM </p><p> Slower than local offheap reads/writes are over the network</p><p> Highly scalable with its distributed design</p><p> Adds resiliency with more fault tolerance</p></li><li><p>JAVAs MOST WIDELY USED CACHE</p></li><li><p> Seamless integration with many popular Java frameworks/applications</p></li><li><p> Open Source </p><p> Current in CF2016 - Ehcache 2.10.0</p><p> Ehcache 3.x (complete overhaul with lots of improvements!!</p><p> Revamped API that leverages Java generics and simplifies Cache interactions</p><p> Full compatibility with javax.cache API (JSR-107)</p><p> Offheap storage capabilities, including offheap only caches</p><p> Out of the box Spring Caching and Hibernate integration thanks to the javax.cache support</p><p> Significant improvement in performance over all its previous versions</p><p> And many more ... (more at www.ehcache.org)</p></li><li><p>90% of Data in </p><p>Memory</p><p>MODERNIZE Database</p><p>90% of Data in </p><p>Database</p><p>Memory</p><p>App Response Time</p><p>MillisecondsApp Response Time</p><p>Microseconds</p></li><li><p>Since ColdFusion 9</p></li><li><p>ColdFusion's Ehcache resources</p><p>1. CF2016 Ehcache 2.10.0 (Latest Ehcache in 2.x line: 2.10.2)</p><p>2. CF 2016 Ehcache libs:</p><p> /cfusion/lib/ehcache-2.10.0.jar (core library)</p><p> /cfusion/lib/ehcache-web-2.0.4.jar (web content caching)</p><p> /cfusion/lib/hibernate-ehcache-4.3.10.Final.jar</p><p>3. CF 2016 Ehcache configurations:</p><p> /cfusion/lib/ehcache.xml</p><p> /cfusion/lib/auth-ehcache.xml</p><p> /cfusion/lib/ehcache-default-config.xml</p></li><li><p>ColdFusion's current use of Ehcache</p><p> CF Authentication:</p><p>auth---ehcache.xml: authcache, authtokenmappingcache</p><p> Internal Caching (CF templates, component paths)</p><p> - Cache fragments of html</p><p> - Cache DB calls</p></li><li><p>A Classic CF application</p></li><li><p>A common challenge</p><p>As the application user base increases the user experience starts to get questioned (?)</p></li><li><p>Lets get the plow working </p><p>A quick and simple solution Ehcache Standalone (LOCAL CACHING)</p></li><li><p>Improved caching Ehcache Replication</p><p>Improve Caching with some caveats</p></li><li><p>Coldfusion + Ehcache + Terracotta Opensource</p><p>=</p><p>Seamless, Powerful Distributed In-Memory </p><p>Caching with Free Open-Source Software</p></li><li><p>Just a little tweak on the Ehcache.xml</p></li><li><p>Terracotta 4.x Open Source Offering/Architecture</p><p> Standard Java</p><p> Proven TBs scale capacity</p><p> Not managed by the JVM </p><p>No Garbage Collections </p><p>Predictable latencies</p><p> No specialized appliance needed</p></li><li><p>Easy scalability: New clients can access all cached data</p></li><li><p>Powerful H/A = Automatic failover/no cache data loss</p></li><li><p>ColdFusion + Ehcache +Terracotta</p><p>Terracotta Distributed Ehcache: High Scalability Caching</p></li><li><p>Coldfusion + Ehcache + Terracotta Bigmemory</p><p>=</p><p>Seamless, Powerful Distributed In-Memory </p><p>Caching with Free Open-Source Software</p></li><li><p>Any kind of data can be stored in Terracotta BigMemory to make</p><p>an application speed up &amp; scale out</p><p>Terracotta BigMemory has different tiers for data storage</p><p>that can be configured based on an applications</p><p>requirements</p><p>Terracotta In-Memory Data grid - Rich data storage &amp; Access</p></li><li><p>Terracotta BigMemory Scale out indefinitely</p></li><li><p>Terracotta BigMemory Performance Scaling</p><p>Terracotta BigMemory Max* provides predicable latency and throughput as data volume increases</p></li><li><p>Choose your own cache read consistency </p><p>with simple config change</p></li><li><p>Terracotta Management Console</p><p>View your Terracotta servers and clients topology</p></li><li><p>Terracotta BigMemory Manage &amp; Monitor</p><p>Track performance trends and discovering potential issues. </p></li><li><p>Terracotta Management Console</p><p>Monitor all cache instances and their configuration and manage your cache/cache manager.</p></li><li><p>Terracotta Management Console</p><p>BigMemory SQL queries against your caches</p></li><li><p>Terracotta BigMemory Fast Restart Store</p><p>Big Memory's disk persistence and Fast Restartability</p></li><li><p>Setting up Coldfusion 2016 </p><p>with Terracotta 4.3.2</p></li><li><p>Terracotta OSS Setup is just a few steps </p><p>1. Download Terracotta OSS (latest terracotta-4.3.2.tar.gz) at</p><p>http://www.terracotta.org/downloads/open-source/catalog</p><p>2. Extract to the location of your choice</p><p>3. Ensure JAVA_HOME is set</p><p>4. Navigate to /server/bin</p><p>5. Start with default single node config by executing:</p><p>start-tc-server.sh (or .bat)</p><p>6. Terracotta process is now accessible at IP:9510</p><p>Note: If setting up Terracotta in active/mirror setup, tc---config.xml must be created and referenced</p><p>at startup: </p><p>start-tc-server.sh (or .bat) -f /tc-config.xml n </p></li><li><p>Connecting ColdFusion to Terracotta in few steps </p><p>1. Copy Ehcache + Terracotta libs to /cfusion/lib </p><p> /apis/ehcache/lib/ehcache-2.10.1.jar</p><p> /apis/toolkit/lib/terracotta-toolkit-runtime-4.3.2.jar</p><p>2. Add terracotta-specifics configurations in CF ehcache configs:</p><p> /cfusion/lib/ehcache.xml</p><p> /cfusion/lib/auth-ehcache.xml</p><p>3. Restart CF</p><p>4. Notice Terracotta connection in CF logs</p></li><li><p>All the below CF caches are now in Terracotta</p><p> CF Authentication:</p><p>auth---ehcache.xml: authcache, authtokenmappingcache</p><p> Internal Caching (CF templates, component paths)</p><p> - Cache fragments of html</p><p> - Cache DB calls</p></li><li><p>Still so much used and Distributed </p><p>The Picture says it all !!! The power of distributed In-Memory computing. </p></li><li><p>Customer Use cases</p></li><li><p>Success Stories: Fortune 500 online payment processor</p><p>Radically Improving Profitability With Better, Faster </p><p>Fraud DetectionSPEED</p><p>What they wanted</p><p>Before BigMemory</p><p> Dramatically boost bottom-line profit through faster, more accurate fraud detection</p><p> Lost 30 cents on every $100 to fraud With Oracle Exadata, failed to meet 800 ms </p><p>SLA around 10% of time</p><p> Limited to 50 rules, even though each new rule generated $12 million in profit</p></li><li><p>Success Stories: Fortune 500 online payment processor</p><p>SPEEDSPEED</p><p>After BigMemory:</p><p> Savings of tens of millions of dollars in reduced costs from missed SLAs and fraudulent charges</p><p> Meeting stricter 650-millisecond SLA 99% of time </p><p> Savings of $1 million annually in reduced database licenses</p><p> Plans to expand from 4TB to 150TB for new applications and to achieve 250 millisecond SLA</p></li><li><p>Success Stories: Healthcare.gov</p></li><li><p>The team began almost immediately to </p><p>cache the data. The result was encouraging: </p><p>the site's overall response time--the time it </p><p>took a page to load--dropped on the evening </p><p>of Oct. 22 from eight seconds to two. That </p><p>was still terrible, of course, but it represented </p><p>such an improvement that it cheered the </p><p>engineers. They could see that HealthCare.gov </p><p>could be saved instead of scrapped.</p><p>Success Stories: Healthcare.gov</p></li><li><p>Challenges All data access to backend database (many round-trips) 10+ seconds response times Numerous down-times due to concurrent users</p><p>Benefits Provide in-memory data access such as subscriber data and provider </p><p>comparison information Session replication of user profile info Performance &amp; Scalability</p><p>Success Stories: Healthcare.gov</p></li><li><p>App </p><p>Server</p><p>App ServerApp Server</p><p>App ServerApp Server</p><p>Ehcache</p><p>App ServerApp Servers</p><p>App Server</p><p>Ehcache</p><p>Security Gateway</p><p>Presentation Zone Application Zone</p><p>App Server</p><p>App Servers</p><p>JMS</p><p>Individual </p><p>&amp; Families</p><p>Issuers</p><p>3rd Parties</p><p>(B2B)</p><p>SOR</p></li><li><p>Thank you!</p><p>Not new but still makes a difference everyday!</p></li><li><p>Questions?</p><p>www.ehcache.org</p><p>www.terracotta.org</p><p>www.softwareag.com</p><p>Shailen Prasad</p><p>Sr. Mgr, Product Management &amp; Strategy (Terracotta), </p><p>Software AG USA, Inc.</p><p>Shailendra.prasad@softwareag.com</p><p>www.linkedin.com/in/shailenprasad</p><p>www.twitter.com/shailenprasad</p></li><li><p>Thank you!</p></li></ul>

Recommended

View more >