SlideShare a Scribd company logo
1 of 39
Download to read offline
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Accelerating Application Performance
Using In-Memory Caching in AWS
Omer Zaki (omerz@amazon.com)
Shakil Langha (slangha@amazon.com)
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Caching Overview
Memcached
Amazon ElastiCache
Use Cases & Design Patterns
Demo
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Users
Web Server
Database Server
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 1: Users hit your web app
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 1: Users hit your web app
Step 2: The Web App queries the Database
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 1: Users hit your web app
Step 2: The Web App queries the Database
Step 3: The Database returns the Result
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 1: Users hit your web app
Step 2: The Web App queries the Database
Step 3: The Database returns the Result
Step 4: The Web App returns the Page
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 5: You scale Web and Database Servers
Web
Server
DB
Server
Web
Server
DB
Server
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 5: You scale Web and Database Servers
Step 6: Now What?
Web
Server
DB
Server
Web
Server
DB
Server
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
A Typical Web Application
Web
Server
DB
Server
Step 5: You scale Web and Database Servers
Step 6: Now What?
Step 7: Use a Cache
Web
Server
Web
Server
DB
Server
Cache
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
What is a Cache?
Component that stores frequently accessed data in memory
Requests for data in the cache are returned faster
Benefits:
• Faster responses for cached data
• Reduces load on your database
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Why Use a Cache?
For a majority of web applications, workloads are read
heavy
• Often as high as 80-90% reads vs. writes
Memory is orders of magnitude faster than disk
• Latency can be reduced from milliseconds to microseconds
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Caching: An Example
Example: Get John Smith’s Phone Number
First Time:
Cache = {}
Step 1: Look in the cache. It’s empty; ‘cache miss’
Step 2: Get the value from the DB; update the cache
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Caching: An Example
Example: Get John Smith’s Phone Number
Second Time:
Cache = {‘John Smith’ : ‘206-555-1212’}
Step 1: Look in the cache. Return the result; ‘cache hit’
Step 2: Until John’s number changes, we don’t hit the DB
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Caching: An Example
Example: John gets a new phone number – ‘415-555-1212’
Cache Invalidation:
Cache = {‘John Smith’ : ‘206-555-1212’} (out of date)
Step 1: Update Database with John’s new number
Step 2: Update the cache with John’s new number
Cache = {‘John Smith’ : ‘415-555-1212’}
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Caching: Pros & Cons
Pros
• Speed up applications, especially if they are read-intensive
• Reduce load on your database servers
Cons
• Requires a change in application architecture
• Application needs to ensure data in the cache is current
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Caching Overview
Memcached
Amazon ElastiCache
Use Cases & Design Patterns
Demo
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Memcached: Overview
Memcached (read: mem-cache-dee)
Free, open-source, high-performance, in-memory key value
store
Developed for LiveJournal in 2003
Used by many of the worlds top websites:
• YouTube, Facebook, Twitter, Pinterest, Tumblr, …
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Memcached: Architecture
Servers with key-value associative
arrays
Client software populates the array
and queries it
Clients know about all the servers
Servers don’t communicate with
each other
Least Recently Used
No persistence
Source: http://architects.dzone.com/news/notes-memcached
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Memcached: Storing Data
Stores arbitrary data
• HTML snippets
• Database query results
• Computed results
Keys are limited to 250 bytes
Values are limited to 1Mb
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Caching Overview
Memcached
Amazon ElastiCache
Use Cases & Design Patterns
Demo
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Amazon ElastiCache
Web service that lets you easily
create and use cache clusters in
the cloud
100% Memcached compatible
Managed, scalable, secure
Pay-as-you-go, and flexible, so
you can add capacity when you
need it
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Amazon ElastiCache: Benefits
Easy to
Deploy
Deploy multi-
node cache
clusters with a
few button
clicks or API
calls
Easy to
Migrate
100%
Memcached
compatible
Existing code
will work when
you update
server lists
Easy to
Administer
Automatically
replaces failed
nodes and
patches
software
CloudWatch
enables you to
monitor cache
performance
metrics
Easy to
Scale
Add or remove
cache nodes
with a few
button clicks,
or API calls
Easy to
Secure
Works well
with EC2 and
DB Security
groups which
means the
cache is
secure
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Caching Overview
Memcached
Amazon ElastiCache
Use Cases & Design Patterns
Demo
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Common Use Cases
Social networks
Gaming
Media and News Sites
Q&A Portals
E-Commerce
Recommendation Engines
Mobile app back-ends
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Sample Deployment: Gaming
Auto-scaling front end
Amazon ElastiCache
Amazon RDS
Amazon S3
Amazon CloudFront
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Common Design Patterns
Database offloading
• Allows web apps to scale independent of backend data tier
Session management for transient data
• Increment/decrement high scores for gaming environments
In memory storage for difficult / time consuming tasks
• Picture ids for all pictures tagged with a particular keyword
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Anti-Patterns
Build application logic assuming cache
hit latency
Put objects into cache without Time-
To-Live set (TTL)
Sequentially sending single operations
to cache (avoiding usage of batched
operations)
Configuring Memcached client to use
Redistribute Failure mode for
ElastiCache cache nodes
Resolving DNS only once.
Failing application request for cache
miss.
Using Memcached as a durable store.
Not designing application error paths
regarding cache operations
• Connection timeouts, operation
timeouts, etc.
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Best Practices
Share Memcached Client objects in application
Use TTLs (short TTLs)
Consider Memory for Connections Overhead
Use CloudWatch Alarms / SNS Alerts
Use Consistent Hashing
Use Auto Discovery
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Agenda
Caching Overview
Memcached
Amazon ElastiCache
Use Cases & Design Patterns
Demo
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Adding Caching to a Web App
Existing Web App running in EC2
• Using RDS MySQL database
Steps
1. Create ElastiCache Cluster with 2 cache nodes
2. Modify the Web App to use Caching
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Create Cache Cluster: Cluster Specification
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Create Cache Cluster: Security / Parameters
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Create Cache Cluster: Cluster Created
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Modify Web App to use Caching
Initialization
import memcache
CACHE_NODES = ['hostname1:port1',
'hostname2:port2']
mc = memcache.Client(CACHE_NODES)
Key Lookup
KEY = "demo.key"
KEY_EXPIRY_SECONDS = 60
value = mc.get(key)
if (not value):
value = getDataFromExistingLogic()
#retrieve from existing app logic -
database, filesystem, other processing
mc.set(key, value, time =
KEY_EXPIRY_SECONDS)
return value
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Web App with Caching
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Performance Improvement
Performance run using Multi-Mechanize
• Runtime: 600 seconds
• Time-series interval: 5 seconds
• ElastiCache usage configured to start at 200 seconds mark
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Performance Improvement
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Questions

More Related Content

What's hot

Wordpress Optimization Settings
Wordpress Optimization Settings Wordpress Optimization Settings
Wordpress Optimization Settings
webhostingguy
 

What's hot (19)

High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web Sites
 
High Performance Websites By Souders Steve
High Performance Websites By Souders SteveHigh Performance Websites By Souders Steve
High Performance Websites By Souders Steve
 
Plop
PlopPlop
Plop
 
Qa fest kiev_when its just too slow
Qa fest kiev_when its just too slowQa fest kiev_when its just too slow
Qa fest kiev_when its just too slow
 
Threadneedle when its just too slow
Threadneedle when its just too slowThreadneedle when its just too slow
Threadneedle when its just too slow
 
Testing Mobile App Performance MOT Edinburgh
Testing Mobile App Performance MOT EdinburghTesting Mobile App Performance MOT Edinburgh
Testing Mobile App Performance MOT Edinburgh
 
Its timetostopstalling sw_mobile_bristol
Its timetostopstalling sw_mobile_bristolIts timetostopstalling sw_mobile_bristol
Its timetostopstalling sw_mobile_bristol
 
Mobile web perf Amsterdam Tech Tips
Mobile web perf Amsterdam Tech TipsMobile web perf Amsterdam Tech Tips
Mobile web perf Amsterdam Tech Tips
 
WordCamp RI 2015 - Beginner WordPress Workshop
WordCamp RI 2015 - Beginner WordPress Workshop   WordCamp RI 2015 - Beginner WordPress Workshop
WordCamp RI 2015 - Beginner WordPress Workshop
 
Performance Implications of Mobile Design
Performance Implications of Mobile DesignPerformance Implications of Mobile Design
Performance Implications of Mobile Design
 
Ux connect london_fastandbeautiful
Ux connect london_fastandbeautifulUx connect london_fastandbeautiful
Ux connect london_fastandbeautiful
 
Html Optimization for SEO
Html Optimization for SEOHtml Optimization for SEO
Html Optimization for SEO
 
Mobius keynote
Mobius keynoteMobius keynote
Mobius keynote
 
Boost and SEO
Boost and SEOBoost and SEO
Boost and SEO
 
Wordpress Optimization Settings
Wordpress Optimization Settings Wordpress Optimization Settings
Wordpress Optimization Settings
 
Edi react fastandbeautiful
Edi react fastandbeautifulEdi react fastandbeautiful
Edi react fastandbeautiful
 
Imagesandvideo tallinn
Imagesandvideo tallinnImagesandvideo tallinn
Imagesandvideo tallinn
 
High Performance Web - Full Stack Toronto
High Performance Web - Full Stack TorontoHigh Performance Web - Full Stack Toronto
High Performance Web - Full Stack Toronto
 
Mobile App and Web Performance Testing
Mobile App and Web Performance TestingMobile App and Web Performance Testing
Mobile App and Web Performance Testing
 

Viewers also liked

AWS Summit 2011: Customer Presentation - NYTimes
AWS Summit 2011: Customer Presentation - NYTimesAWS Summit 2011: Customer Presentation - NYTimes
AWS Summit 2011: Customer Presentation - NYTimes
Amazon Web Services
 
GOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case StudyGOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case Study
Amazon Web Services
 

Viewers also liked (20)

NoSQL like there is No Tomorrow
NoSQL like there is No TomorrowNoSQL like there is No Tomorrow
NoSQL like there is No Tomorrow
 
AWS Summit Sydney 2014 | Secure Hadoop as a Service - Session Sponsored by Intel
AWS Summit Sydney 2014 | Secure Hadoop as a Service - Session Sponsored by IntelAWS Summit Sydney 2014 | Secure Hadoop as a Service - Session Sponsored by Intel
AWS Summit Sydney 2014 | Secure Hadoop as a Service - Session Sponsored by Intel
 
Canberra Symposium Keynote
Canberra Symposium KeynoteCanberra Symposium Keynote
Canberra Symposium Keynote
 
AWS - Managing Your Cloud Assets 2013
AWS - Managing Your Cloud Assets 2013AWS - Managing Your Cloud Assets 2013
AWS - Managing Your Cloud Assets 2013
 
Jump Start your First Hour with AWS
Jump Start your First Hour with AWSJump Start your First Hour with AWS
Jump Start your First Hour with AWS
 
Scalability and Availability
Scalability and AvailabilityScalability and Availability
Scalability and Availability
 
AWS Summit 2011: Customer Presentation - NYTimes
AWS Summit 2011: Customer Presentation - NYTimesAWS Summit 2011: Customer Presentation - NYTimes
AWS Summit 2011: Customer Presentation - NYTimes
 
Automating Backup & Archiving with AWS and CommVault
Automating Backup & Archiving with AWS and CommVaultAutomating Backup & Archiving with AWS and CommVault
Automating Backup & Archiving with AWS and CommVault
 
AWS Summit Stockholm 2014 – B2 – Migrating enterprise applications to AWS
AWS Summit Stockholm 2014 – B2 – Migrating enterprise applications to AWSAWS Summit Stockholm 2014 – B2 – Migrating enterprise applications to AWS
AWS Summit Stockholm 2014 – B2 – Migrating enterprise applications to AWS
 
Mobile apps and iot aws lambda
Mobile apps and iot aws lambdaMobile apps and iot aws lambda
Mobile apps and iot aws lambda
 
GOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case StudyGOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case Study
 
Gaming in the Cloud at Websummit Dublin
Gaming in the Cloud at Websummit DublinGaming in the Cloud at Websummit Dublin
Gaming in the Cloud at Websummit Dublin
 
AWS Sydney Summit 2013 - Architecting for High Availability
AWS Sydney Summit 2013 - Architecting for High AvailabilityAWS Sydney Summit 2013 - Architecting for High Availability
AWS Sydney Summit 2013 - Architecting for High Availability
 
AWS Webcast - Webinar Series for State and Local Government #3: Discover the ...
AWS Webcast - Webinar Series for State and Local Government #3: Discover the ...AWS Webcast - Webinar Series for State and Local Government #3: Discover the ...
AWS Webcast - Webinar Series for State and Local Government #3: Discover the ...
 
AWS Startup Insights Singapore
AWS Startup Insights SingaporeAWS Startup Insights Singapore
AWS Startup Insights Singapore
 
AWS Webcast - Build Agile Applications in AWS Cloud
AWS Webcast - Build Agile Applications in AWS CloudAWS Webcast - Build Agile Applications in AWS Cloud
AWS Webcast - Build Agile Applications in AWS Cloud
 
AWS Webinar: What is Cloud Computing? November 2013
AWS Webinar: What is Cloud Computing?  November 2013AWS Webinar: What is Cloud Computing?  November 2013
AWS Webinar: What is Cloud Computing? November 2013
 
AWS Customer Presentation - Cruxy.com
AWS Customer Presentation - Cruxy.com AWS Customer Presentation - Cruxy.com
AWS Customer Presentation - Cruxy.com
 
Understanding AWS Security
Understanding AWS SecurityUnderstanding AWS Security
Understanding AWS Security
 
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
 

Similar to AWS Webcast - Accelerating Application Performance Using In-Memory Caching in AWS

Migrate and Modernize Your Database
Migrate and Modernize Your DatabaseMigrate and Modernize Your Database
Migrate and Modernize Your Database
Amazon Web Services
 

Similar to AWS Webcast - Accelerating Application Performance Using In-Memory Caching in AWS (20)

Backup and Recovery for Linux With Amazon S3
Backup and Recovery for Linux With Amazon S3Backup and Recovery for Linux With Amazon S3
Backup and Recovery for Linux With Amazon S3
 
AWS Webinar - Intro to Amazon Cloudfront 13-09-17
AWS Webinar -  Intro to Amazon Cloudfront 13-09-17AWS Webinar -  Intro to Amazon Cloudfront 13-09-17
AWS Webinar - Intro to Amazon Cloudfront 13-09-17
 
CIS13: AWS Identity and Access Management
CIS13: AWS Identity and Access ManagementCIS13: AWS Identity and Access Management
CIS13: AWS Identity and Access Management
 
AWS Webcast - Using Amazon CloudFront-Accelerate Your Static, Dynamic, Intera...
AWS Webcast - Using Amazon CloudFront-Accelerate Your Static, Dynamic, Intera...AWS Webcast - Using Amazon CloudFront-Accelerate Your Static, Dynamic, Intera...
AWS Webcast - Using Amazon CloudFront-Accelerate Your Static, Dynamic, Intera...
 
AWS Webcast - Introducing Amazon Redshift
AWS Webcast - Introducing Amazon RedshiftAWS Webcast - Introducing Amazon Redshift
AWS Webcast - Introducing Amazon Redshift
 
Migrate and Modernize Your Database
Migrate and Modernize Your DatabaseMigrate and Modernize Your Database
Migrate and Modernize Your Database
 
AWSome Day - Solutions Architecture Best Practices
AWSome Day - Solutions Architecture Best PracticesAWSome Day - Solutions Architecture Best Practices
AWSome Day - Solutions Architecture Best Practices
 
AWS Webcast - High Availability with Route 53 DNS Failover
AWS Webcast - High Availability with Route 53 DNS FailoverAWS Webcast - High Availability with Route 53 DNS Failover
AWS Webcast - High Availability with Route 53 DNS Failover
 
AWS Webcast - Data Integration into Amazon Redshift
AWS Webcast - Data Integration into Amazon RedshiftAWS Webcast - Data Integration into Amazon Redshift
AWS Webcast - Data Integration into Amazon Redshift
 
Speeding up delivery of web content using Amazon Route 53, Elastic Load Balan...
Speeding up delivery of web content using Amazon Route 53, Elastic Load Balan...Speeding up delivery of web content using Amazon Route 53, Elastic Load Balan...
Speeding up delivery of web content using Amazon Route 53, Elastic Load Balan...
 
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdfRodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
Rodney Lester: Well-Architected - Reliability Instructor Led Lab.pdf
 
AWS Webcast - Introducing Amazon RDS for PostgreSQL
AWS Webcast - Introducing Amazon RDS for PostgreSQLAWS Webcast - Introducing Amazon RDS for PostgreSQL
AWS Webcast - Introducing Amazon RDS for PostgreSQL
 
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
 
Build a Multi-Region Serverless Application for Resilience & High Availabilit...
Build a Multi-Region Serverless Application for Resilience & High Availabilit...Build a Multi-Region Serverless Application for Resilience & High Availabilit...
Build a Multi-Region Serverless Application for Resilience & High Availabilit...
 
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
 
AWS Webcast - Intro CloudFront Reporting Features
AWS Webcast - Intro CloudFront Reporting FeaturesAWS Webcast - Intro CloudFront Reporting Features
AWS Webcast - Intro CloudFront Reporting Features
 
Accelerate Database Development and Testing with Amazon Aurora (DAT313) - AWS...
Accelerate Database Development and Testing with Amazon Aurora (DAT313) - AWS...Accelerate Database Development and Testing with Amazon Aurora (DAT313) - AWS...
Accelerate Database Development and Testing with Amazon Aurora (DAT313) - AWS...
 
Chaos Engineering
Chaos EngineeringChaos Engineering
Chaos Engineering
 
Introduction to GluonCV
Introduction to GluonCVIntroduction to GluonCV
Introduction to GluonCV
 
How Dow Jones Uses AWS to Enable Innovation and New Engineering Work (CTD316)...
How Dow Jones Uses AWS to Enable Innovation and New Engineering Work (CTD316)...How Dow Jones Uses AWS to Enable Innovation and New Engineering Work (CTD316)...
How Dow Jones Uses AWS to Enable Innovation and New Engineering Work (CTD316)...
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

AWS Webcast - Accelerating Application Performance Using In-Memory Caching in AWS

  • 1. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Accelerating Application Performance Using In-Memory Caching in AWS Omer Zaki (omerz@amazon.com) Shakil Langha (slangha@amazon.com)
  • 2. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Agenda Caching Overview Memcached Amazon ElastiCache Use Cases & Design Patterns Demo
  • 3. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Users Web Server Database Server
  • 4. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 1: Users hit your web app
  • 5. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 1: Users hit your web app Step 2: The Web App queries the Database
  • 6. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 1: Users hit your web app Step 2: The Web App queries the Database Step 3: The Database returns the Result
  • 7. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 1: Users hit your web app Step 2: The Web App queries the Database Step 3: The Database returns the Result Step 4: The Web App returns the Page
  • 8. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 5: You scale Web and Database Servers Web Server DB Server Web Server DB Server
  • 9. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 5: You scale Web and Database Servers Step 6: Now What? Web Server DB Server Web Server DB Server
  • 10. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. A Typical Web Application Web Server DB Server Step 5: You scale Web and Database Servers Step 6: Now What? Step 7: Use a Cache Web Server Web Server DB Server Cache
  • 11. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. What is a Cache? Component that stores frequently accessed data in memory Requests for data in the cache are returned faster Benefits: • Faster responses for cached data • Reduces load on your database
  • 12. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Why Use a Cache? For a majority of web applications, workloads are read heavy • Often as high as 80-90% reads vs. writes Memory is orders of magnitude faster than disk • Latency can be reduced from milliseconds to microseconds
  • 13. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Caching: An Example Example: Get John Smith’s Phone Number First Time: Cache = {} Step 1: Look in the cache. It’s empty; ‘cache miss’ Step 2: Get the value from the DB; update the cache
  • 14. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Caching: An Example Example: Get John Smith’s Phone Number Second Time: Cache = {‘John Smith’ : ‘206-555-1212’} Step 1: Look in the cache. Return the result; ‘cache hit’ Step 2: Until John’s number changes, we don’t hit the DB
  • 15. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Caching: An Example Example: John gets a new phone number – ‘415-555-1212’ Cache Invalidation: Cache = {‘John Smith’ : ‘206-555-1212’} (out of date) Step 1: Update Database with John’s new number Step 2: Update the cache with John’s new number Cache = {‘John Smith’ : ‘415-555-1212’}
  • 16. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Caching: Pros & Cons Pros • Speed up applications, especially if they are read-intensive • Reduce load on your database servers Cons • Requires a change in application architecture • Application needs to ensure data in the cache is current
  • 17. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Agenda Caching Overview Memcached Amazon ElastiCache Use Cases & Design Patterns Demo
  • 18. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Memcached: Overview Memcached (read: mem-cache-dee) Free, open-source, high-performance, in-memory key value store Developed for LiveJournal in 2003 Used by many of the worlds top websites: • YouTube, Facebook, Twitter, Pinterest, Tumblr, …
  • 19. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Memcached: Architecture Servers with key-value associative arrays Client software populates the array and queries it Clients know about all the servers Servers don’t communicate with each other Least Recently Used No persistence Source: http://architects.dzone.com/news/notes-memcached
  • 20. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Memcached: Storing Data Stores arbitrary data • HTML snippets • Database query results • Computed results Keys are limited to 250 bytes Values are limited to 1Mb
  • 21. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Agenda Caching Overview Memcached Amazon ElastiCache Use Cases & Design Patterns Demo
  • 22. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Amazon ElastiCache Web service that lets you easily create and use cache clusters in the cloud 100% Memcached compatible Managed, scalable, secure Pay-as-you-go, and flexible, so you can add capacity when you need it
  • 23. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Amazon ElastiCache: Benefits Easy to Deploy Deploy multi- node cache clusters with a few button clicks or API calls Easy to Migrate 100% Memcached compatible Existing code will work when you update server lists Easy to Administer Automatically replaces failed nodes and patches software CloudWatch enables you to monitor cache performance metrics Easy to Scale Add or remove cache nodes with a few button clicks, or API calls Easy to Secure Works well with EC2 and DB Security groups which means the cache is secure
  • 24. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Agenda Caching Overview Memcached Amazon ElastiCache Use Cases & Design Patterns Demo
  • 25. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Common Use Cases Social networks Gaming Media and News Sites Q&A Portals E-Commerce Recommendation Engines Mobile app back-ends
  • 26. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Sample Deployment: Gaming Auto-scaling front end Amazon ElastiCache Amazon RDS Amazon S3 Amazon CloudFront
  • 27. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Common Design Patterns Database offloading • Allows web apps to scale independent of backend data tier Session management for transient data • Increment/decrement high scores for gaming environments In memory storage for difficult / time consuming tasks • Picture ids for all pictures tagged with a particular keyword
  • 28. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Anti-Patterns Build application logic assuming cache hit latency Put objects into cache without Time- To-Live set (TTL) Sequentially sending single operations to cache (avoiding usage of batched operations) Configuring Memcached client to use Redistribute Failure mode for ElastiCache cache nodes Resolving DNS only once. Failing application request for cache miss. Using Memcached as a durable store. Not designing application error paths regarding cache operations • Connection timeouts, operation timeouts, etc.
  • 29. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Best Practices Share Memcached Client objects in application Use TTLs (short TTLs) Consider Memory for Connections Overhead Use CloudWatch Alarms / SNS Alerts Use Consistent Hashing Use Auto Discovery
  • 30. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Agenda Caching Overview Memcached Amazon ElastiCache Use Cases & Design Patterns Demo
  • 31. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Adding Caching to a Web App Existing Web App running in EC2 • Using RDS MySQL database Steps 1. Create ElastiCache Cluster with 2 cache nodes 2. Modify the Web App to use Caching
  • 32. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Create Cache Cluster: Cluster Specification
  • 33. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Create Cache Cluster: Security / Parameters
  • 34. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Create Cache Cluster: Cluster Created
  • 35. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Modify Web App to use Caching Initialization import memcache CACHE_NODES = ['hostname1:port1', 'hostname2:port2'] mc = memcache.Client(CACHE_NODES) Key Lookup KEY = "demo.key" KEY_EXPIRY_SECONDS = 60 value = mc.get(key) if (not value): value = getDataFromExistingLogic() #retrieve from existing app logic - database, filesystem, other processing mc.set(key, value, time = KEY_EXPIRY_SECONDS) return value
  • 36. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Web App with Caching
  • 37. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Performance Improvement Performance run using Multi-Mechanize • Runtime: 600 seconds • Time-series interval: 5 seconds • ElastiCache usage configured to start at 200 seconds mark
  • 38. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Performance Improvement
  • 39. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. Questions