Caching In The Cloud
Click here to load reader
-
Upload
alex-miller -
Category
Technology
-
view
1.476 -
download
1
description
Transcript of Caching In The Cloud
Caching in the CloudAlex MillerTerracotta
Twitter: @puredanger Blog: http://tech.puredanger.com
Clouds
• Blah blah blah scalability blah blah blah elasticity blah blah blah efficiency blah blah blah
Database Pain• Scale in cloud
• Born in enterprise -> doesn’t work at web scale
• Expensive (RAC) or complicated (MySQL sharding)
• Elasticity in cloud
• Harder to migrate disk than to migrate processes
• Single coordination point constrains flexibility
Ideal Cloud Data Layer
• Protects “in-flight” data - durability
• Has low latency, high throughput
• Deploys elastically w/app tier
• Doesn’t require app changes
NoSQL
• Key-value stores
• Document databases
• And many other flavors...
Terracotta
• Open-source Java clustering technology
• Clustered - dynamically add/remove nodes
• High availability - server-based w/failover
• Data is redundant, copied to disk for backup
• In-memory speed
Don’t Change Your App!
• Hibernate Second Level Cache - ORM
• Ehcache - data caching
• Quartz - scheduling and job recovery
• HTTP Sessions - session availability
• Spring - app wiring and state
Database Offload
• Scale your app (use the cloud)
• Scale your data (use Terracotta)
• Don’t scale your db (use for historical)
Hotel company• Business
• Room reservation + loyalty points
• Multiple mainframe apps
• Estimate: $12M, 5 years -> Oracle RAC
• Instead:
• Private cloud
• VMWare, Spring, Terracotta
• Saving $11M / year on DB and App Server licenses
Deployment Approach
Travel Reservation System
• Problem
• Mainframe costs >$5M / year in EDS fees
• Retain high reliability in lower cost env
• Solution
• Private data cloud - Terracotta + Ehcache
• Saved $5M / year
• 99.99% reliability
Gnip
• Web feeds, message transformation, delivery
• Twitter, Delicious, Flickr, etc
• Problem: large quantities of transient data
• Solution:
• 12 nodes on EC2
• Terracotta for data storage
• 50k TPS
Scalability Continuum
• Write your app once using standard open source technologies
• Same app works on your machine, in your test env, in the cloud
• Change where and how you deploy, not your app