SlideShare a Scribd company logo
App Engine Memcache Basics
App Engine: Memcache Basics

Who? Why?
Ido Green
Solutions Architect
plus.google.com/greenido

greenido.wordpress.com
App Engine: Memcache Basics

Topics We Cover in This Lesson
● What is Memcache?
● Why do we need Memcache?
● How to Use Memcache?
● Caveats And Solutions
App Engine: Memcache Basics

What Is Memcache?
What is Memcache?

What is Memcache?
● Memcache is an in-memory Key-Value Pairs data store
○ Put a value with a key
○ Get a value with a key
value

key
"user001" : "John Doe"

"user002" : "Larry Page"

● key or value can be anything that is serializable
● Memcache is a shared service accessed via App Engine APIs.
What Is Memcache

What Do We Use Memcache For?
●

●

●

Caching In Front of Datastore
○ Cache entities for low-latency reads
○ Integrated into most ORM frameworks (ndb, Obectify ..)
Caching for Read heavy operations
○ User authentication token and session data
○ APIs call or other computation results
Semi-durable Shared state Cross App Instances
○ Sessions
○ Counters / Metrics
○ Application Configurations
App Engine: Memcache Basics

Why Do We Need Memcache?
Why do we need Memcache?

Why Do We Use Memcache?

● Improve Application Performance
● Reduce Application Cost
Why do we need Memcache?

How Fast Can Memcache be? And How Much?

Datastore Query Latency

Memcache Read Latency
How to Use Memcache
How to Use Memcache

Memcache APIs
● Java
○ JCache APIs
○ GAE Low-Level Memcache APIs
○ Objectify for Datastore

● Python
○ google.appengine.api.memcache module
○ ndb for Datastore
How to Use Memcache

General Memcache Usage Pattern
Coordinate data read with Datastore:
● Check if Memcache value exists
○ if it does, display/use cached value directly; otherwise
○ fetch the value from Datastore and write the value to
Memcache

Coordinate data write with Datastore:
● Update Memcache value
○ to handle race condition, leverage put if
untouched/compare and set to detect race conditions

● Write the value to Datastore
○ optionally, leverage the task queue for background writes
How to Use Memcache

Using GAE Client Library (Java)
import com.google.appengine.api.memcache;
...
MemcacheService syncCache = MemcacheServiceFactory.
getMemcacheService();
// Act on error as cache miss
syncCache.setErrorHandler(ErrorHandlers.
getConsistentLogAndContinue(Level.INFO));
value = (byte[]) syncCache.get(key); // read from cache
if (value == null) {
value = getDataFromDb(key); // fetch value from datastore
syncCache.put(key, value); // write to cache
// (key and value must be
serializable)
}
...
How to Use Memcache

Using GAE Client Library (Python)
from google.appengine.api import memcache
...
value = memcache.get(key)
if value is None:
value = get_value_from_db(key)
if not memcache.add(key, value):
logging.error('Memcache add failed.')
...
How to Use Memcache

Batch Operations
● getAll(), putAll(), deleteAll()
A single read or write operation for multiple memcache
entries

Note

● Further improve Memcache performance by reducing network traffics
● Batch size < 32 MB
How to Use Memcache

Atomic Operations
● increment(key, delta), incrementAll(...),
Provide atomic increment of numeric value(s)
● getIdentifiable(), putIfUntouched() in Java, or cas() in Python
A mechanism to update a value consistently by concurrent requests

Note

●

Helps managing memcache data consistency in
multi-instances/concurrent environment
How to Use Memcache

Some Other Features
● Asynchronous calls
Provides a mechanism to make a non-blocking call for memcache
operations
● Namespace
Logically separates data layers for different application purposes (like
multi tenancy) across many GAE services such as Datastore,
Memcache, Task Queue etc...
Caveats And Solutions
Caveats And Solutions
Caveat: Memcache Is Volatile
Entries can be evicted anytime by various reasons:
●
●
●

entry reaches expiration
entry is evicted because memcache memory is full
memcache server fails
Tip
●

It's important to handle cache-miss gracefully!

●

Implements write-through logic by backing
memcache with datastore in your application!
○ Psst... Objectify and ndb do it for you.
Caveats And Solutions
Caveat: Memcache Is Not Transactional
Instance 1 reads $100

$100

$100

Instance 2 reads $100

$100

$100

Instance 2 deducts $20

$80

$80

Instance 1 deducts $30

$70

$70

Tip
Using getIdentifiable() and putIfUntouched(...)
for optimistic locking
Caveats And Solutions
Caveat: Memcache Is A Limited Resource
My Application Does NOT Have Enough Memcache!

Tips
●

Only need to cache what is useful and necessary!

●

Your application should function without memcache!

●

Dedicated Memcache
Caveats And Solutions
Dedicated Memcache

Enabling dedicated memcache from the admin console

1. Provides fixed cache capacity that is exclusive to your application
2. Billed by the GB per hour of cache size. Charged in 15 minute
increments
3. Gives you additional control over cache size. More predictable
performance
Note: Whether shared or dedicated, Memcache is not a durable storage.
Plan for your application to function without Memcache
Discussion And Questions

Key Takeaways
1. Memcache is supported natively in GAE. Take advantage of it to
improve your GAE application performance.
2. Memcache supports open standard JCache API. Many advanced
features are available by GAE Memcache APIs to suit your
application's need i.e. Batch, Atomic, Asynchronous operations
3. Seamless integration with GAE Datastore in a few libraries like
Python ndb and Java Objectify.
4. Read-frequently and write-rarely data is most suitable in combining
with Memcache
5. Handle Memcache's volatility in your application
6. Use Memcache wisely, it is not an unlimited resource
App Engine: Memcache Basics

Thank you!
Questions?

More Related Content

What's hot

Multicore Processors
Multicore ProcessorsMulticore Processors
Multicore Processors
Smruti Sarangi
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
It's Time to ROCm!
It's Time to ROCm!It's Time to ROCm!
It's Time to ROCm!
inside-BigData.com
 
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
Edge AI and Vision Alliance
 
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
Kubernetes dealing with storage and persistence
Kubernetes  dealing with storage and persistenceKubernetes  dealing with storage and persistence
Kubernetes dealing with storage and persistence
Janakiram MSV
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
Novell
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
NexThoughts Technologies
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
Amazon Web Services
 
Persistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShiftPersistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShift
Red Hat Events
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
Opersys inc.
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
Emertxe Information Technologies Pvt Ltd
 
Intro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication ProtocolsIntro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication Protocols
Emertxe Information Technologies Pvt Ltd
 
Introduction to OpenCL
Introduction to OpenCLIntroduction to OpenCL
Introduction to OpenCL
Unai Lopez-Novoa
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
Jérôme Petazzoni
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 
CUDA
CUDACUDA

What's hot (20)

Multicore Processors
Multicore ProcessorsMulticore Processors
Multicore Processors
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
It's Time to ROCm!
It's Time to ROCm!It's Time to ROCm!
It's Time to ROCm!
 
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
 
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
 
Kubernetes dealing with storage and persistence
Kubernetes  dealing with storage and persistenceKubernetes  dealing with storage and persistence
Kubernetes dealing with storage and persistence
 
Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
 
Persistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShiftPersistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShift
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Cuda tutorial
Cuda tutorialCuda tutorial
Cuda tutorial
 
Intro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication ProtocolsIntro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication Protocols
 
Introduction to OpenCL
Introduction to OpenCLIntroduction to OpenCL
Introduction to OpenCL
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
CUDA
CUDACUDA
CUDA
 

Viewers also liked

Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
Simon Su
 
Hack+FuelPHPによるWebサービス開発
Hack+FuelPHPによるWebサービス開発Hack+FuelPHPによるWebサービス開発
Hack+FuelPHPによるWebサービス開発
Yuji Otani
 
HTML5 Experts.jp パフォーマンス・チューニング
HTML5 Experts.jp パフォーマンス・チューニングHTML5 Experts.jp パフォーマンス・チューニング
HTML5 Experts.jp パフォーマンス・チューニング
Yusuke Naka
 
HHVM on CentOS6 本番運用のうまみとつらみ
HHVM on CentOS6 本番運用のうまみとつらみHHVM on CentOS6 本番運用のうまみとつらみ
HHVM on CentOS6 本番運用のうまみとつらみ
Kei KORI
 
PHP7がリリースされたいま、 改めてHackについて考える。
PHP7がリリースされたいま、 改めてHackについて考える。PHP7がリリースされたいま、 改めてHackについて考える。
PHP7がリリースされたいま、 改めてHackについて考える。
Yuji Otani
 
PHP7ではなくHack/HHVMを選ぶ理由
PHP7ではなくHack/HHVMを選ぶ理由PHP7ではなくHack/HHVMを選ぶ理由
PHP7ではなくHack/HHVMを選ぶ理由
Yuji Otani
 
liceo paola cs
liceo paola csliceo paola cs
liceo paola cs
gueroz4
 
Innova day 5^ ed Nanotech - Biomed - Biotech 18 Oct. 2013
Innova day 5^ ed   Nanotech - Biomed - Biotech 18 Oct. 2013Innova day 5^ ed   Nanotech - Biomed - Biotech 18 Oct. 2013
Innova day 5^ ed Nanotech - Biomed - Biotech 18 Oct. 2013
Francesco Baruffi
 
Dec 06, Sermon Am
Dec 06, Sermon AmDec 06, Sermon Am
Dec 06, Sermon Am
Geo Acts
 
Locandina oleodinamica 2010 fluid power 6 ed def
Locandina oleodinamica 2010 fluid power 6 ed defLocandina oleodinamica 2010 fluid power 6 ed def
Locandina oleodinamica 2010 fluid power 6 ed defFrancesco Baruffi
 
Retrospective 2008 The Surfer’s Year
Retrospective 2008 The Surfer’s YearRetrospective 2008 The Surfer’s Year
Retrospective 2008 The Surfer’s Year
sdelastic
 
Sf 02S201test
Sf 02S201testSf 02S201test
Sf 02S201test
guest02b3e
 
VANABBETOTVESSEM
VANABBETOTVESSEMVANABBETOTVESSEM
VANABBETOTVESSEM
dhrvanvessem
 
Wiki Technology By It Rocks
Wiki Technology By It RocksWiki Technology By It Rocks
Wiki Technology By It Rocksnaveenv
 
Java Eye Architecture
Java Eye ArchitectureJava Eye Architecture
Java Eye Architecture
Robbin Fan
 
Unit1Business-English
Unit1Business-EnglishUnit1Business-English
Unit1Business-English
lola guillen
 
Tally Sheet Results - Technology Habits
Tally Sheet Results - Technology HabitsTally Sheet Results - Technology Habits
Tally Sheet Results - Technology Habits
leouy
 

Viewers also liked (20)

Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Hack+FuelPHPによるWebサービス開発
Hack+FuelPHPによるWebサービス開発Hack+FuelPHPによるWebサービス開発
Hack+FuelPHPによるWebサービス開発
 
HTML5 Experts.jp パフォーマンス・チューニング
HTML5 Experts.jp パフォーマンス・チューニングHTML5 Experts.jp パフォーマンス・チューニング
HTML5 Experts.jp パフォーマンス・チューニング
 
HHVM on CentOS6 本番運用のうまみとつらみ
HHVM on CentOS6 本番運用のうまみとつらみHHVM on CentOS6 本番運用のうまみとつらみ
HHVM on CentOS6 本番運用のうまみとつらみ
 
PHP7がリリースされたいま、 改めてHackについて考える。
PHP7がリリースされたいま、 改めてHackについて考える。PHP7がリリースされたいま、 改めてHackについて考える。
PHP7がリリースされたいま、 改めてHackについて考える。
 
PHP7ではなくHack/HHVMを選ぶ理由
PHP7ではなくHack/HHVMを選ぶ理由PHP7ではなくHack/HHVMを選ぶ理由
PHP7ではなくHack/HHVMを選ぶ理由
 
liceo paola cs
liceo paola csliceo paola cs
liceo paola cs
 
Innova day 5^ ed Nanotech - Biomed - Biotech 18 Oct. 2013
Innova day 5^ ed   Nanotech - Biomed - Biotech 18 Oct. 2013Innova day 5^ ed   Nanotech - Biomed - Biotech 18 Oct. 2013
Innova day 5^ ed Nanotech - Biomed - Biotech 18 Oct. 2013
 
Dec 06, Sermon Am
Dec 06, Sermon AmDec 06, Sermon Am
Dec 06, Sermon Am
 
Locandina oleodinamica 2010 fluid power 6 ed def
Locandina oleodinamica 2010 fluid power 6 ed defLocandina oleodinamica 2010 fluid power 6 ed def
Locandina oleodinamica 2010 fluid power 6 ed def
 
Retrospective 2008 The Surfer’s Year
Retrospective 2008 The Surfer’s YearRetrospective 2008 The Surfer’s Year
Retrospective 2008 The Surfer’s Year
 
Sf 02S201test
Sf 02S201testSf 02S201test
Sf 02S201test
 
VANABBETOTVESSEM
VANABBETOTVESSEMVANABBETOTVESSEM
VANABBETOTVESSEM
 
Collaborative Assessment
Collaborative AssessmentCollaborative Assessment
Collaborative Assessment
 
Wiki Technology By It Rocks
Wiki Technology By It RocksWiki Technology By It Rocks
Wiki Technology By It Rocks
 
Java Eye Architecture
Java Eye ArchitectureJava Eye Architecture
Java Eye Architecture
 
Unit1Business-English
Unit1Business-EnglishUnit1Business-English
Unit1Business-English
 
Presentation1
Presentation1Presentation1
Presentation1
 
Europe
EuropeEurope
Europe
 
Tally Sheet Results - Technology Habits
Tally Sheet Results - Technology HabitsTally Sheet Results - Technology Habits
Tally Sheet Results - Technology Habits
 

Similar to Memcache basics on google app engine

How to reduce database load using Memcache
How to reduce database load using MemcacheHow to reduce database load using Memcache
How to reduce database load using Memcache
valuebound
 
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
Wim Godden
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
Mathew Beane
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
Achieve Internet
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
Wim Godden
 
Introduction to Magento Optimization
Introduction to Magento OptimizationIntroduction to Magento Optimization
Introduction to Magento Optimization
Fabio Daniele
 
Large scale virtual Machine log collector (Project-Report)
Large scale virtual Machine log collector (Project-Report)Large scale virtual Machine log collector (Project-Report)
Large scale virtual Machine log collector (Project-Report)Gaurav Bhardwaj
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedAcquia
 
Faster computation with matlab
Faster computation with matlabFaster computation with matlab
Faster computation with matlab
Muhammad Alli
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
Wim Godden
 
Optimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend ServerOptimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend Servervarien
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
Wim Godden
 
Caching in rails
Caching in railsCaching in rails
Caching in rails
Vysakh Sreenivasan
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
Ford AntiTrust
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
Mathew Beane
 
Caching Tips & Tricks
Caching Tips & TricksCaching Tips & Tricks
Caching Tips & Tricks
OutSystems
 
phptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorialphptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorial
Wim Godden
 
Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
Wim Godden
 

Similar to Memcache basics on google app engine (20)

How to reduce database load using Memcache
How to reduce database load using MemcacheHow to reduce database load using Memcache
How to reduce database load using Memcache
 
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
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Introduction to Magento Optimization
Introduction to Magento OptimizationIntroduction to Magento Optimization
Introduction to Magento Optimization
 
Large scale virtual Machine log collector (Project-Report)
Large scale virtual Machine log collector (Project-Report)Large scale virtual Machine log collector (Project-Report)
Large scale virtual Machine log collector (Project-Report)
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
 
Faster computation with matlab
Faster computation with matlabFaster computation with matlab
Faster computation with matlab
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
Optimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend ServerOptimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend Server
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
 
Caching in rails
Caching in railsCaching in rails
Caching in rails
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
 
Caching Tips & Tricks
Caching Tips & TricksCaching Tips & Tricks
Caching Tips & Tricks
 
phptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorialphptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorial
 
Memcache d
Memcache dMemcache d
Memcache d
 
Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
 

More from Ido Green

How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta
Ido Green
 
Crypto 101 and a bit more [Sep-2022]
Crypto 101 and a bit more [Sep-2022]Crypto 101 and a bit more [Sep-2022]
Crypto 101 and a bit more [Sep-2022]
Ido Green
 
The Future of Continuous Software Updates Is Here
The Future of Continuous Software Updates Is HereThe Future of Continuous Software Updates Is Here
The Future of Continuous Software Updates Is Here
Ido Green
 
Open Source & DevOps Market trends - Open Core Summit
Open Source & DevOps Market trends - Open Core SummitOpen Source & DevOps Market trends - Open Core Summit
Open Source & DevOps Market trends - Open Core Summit
Ido Green
 
DevOps as a competitive advantage
DevOps as a competitive advantageDevOps as a competitive advantage
DevOps as a competitive advantage
Ido Green
 
Data Driven DevOps & Technologies (swampUP 2019 keynote)
Data Driven DevOps & Technologies (swampUP 2019 keynote)Data Driven DevOps & Technologies (swampUP 2019 keynote)
Data Driven DevOps & Technologies (swampUP 2019 keynote)
Ido Green
 
Create An Amazing Apps For The Google Assistant!
Create An Amazing Apps For The Google Assistant!Create An Amazing Apps For The Google Assistant!
Create An Amazing Apps For The Google Assistant!
Ido Green
 
VUI Design
VUI DesignVUI Design
VUI Design
Ido Green
 
Google Assistant - Why? How?
Google Assistant - Why? How?Google Assistant - Why? How?
Google Assistant - Why? How?
Ido Green
 
The Google Assistant - Macro View (October 2017)
The Google Assistant - Macro View (October 2017)The Google Assistant - Macro View (October 2017)
The Google Assistant - Macro View (October 2017)
Ido Green
 
Actions On Google - GDD Europe 2017
Actions On Google - GDD Europe 2017Actions On Google - GDD Europe 2017
Actions On Google - GDD Europe 2017
Ido Green
 
Building conversational experiences with Actions on Google
Building conversational experiences with Actions on GoogleBuilding conversational experiences with Actions on Google
Building conversational experiences with Actions on Google
Ido Green
 
Actions On Google - How? Why?
Actions On Google - How? Why?Actions On Google - How? Why?
Actions On Google - How? Why?
Ido Green
 
Startups Best Practices
Startups Best PracticesStartups Best Practices
Startups Best Practices
Ido Green
 
Progressive Web Apps For Startups
Progressive Web Apps For StartupsProgressive Web Apps For Startups
Progressive Web Apps For Startups
Ido Green
 
Earn More Revenue With Firebase and AdMob
Earn More Revenue With Firebase and AdMobEarn More Revenue With Firebase and AdMob
Earn More Revenue With Firebase and AdMob
Ido Green
 
How To Grow Your User Base?
How To Grow Your User Base?How To Grow Your User Base?
How To Grow Your User Base?
Ido Green
 
Amp Overview #YGLF 2016
Amp Overview #YGLF 2016Amp Overview #YGLF 2016
Amp Overview #YGLF 2016
Ido Green
 
AMP - Accelerated Mobile Pages
AMP - Accelerated Mobile PagesAMP - Accelerated Mobile Pages
AMP - Accelerated Mobile Pages
Ido Green
 
From AMP to PWA
From AMP to PWAFrom AMP to PWA
From AMP to PWA
Ido Green
 

More from Ido Green (20)

How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta How to get things done - Lessons from Yahoo, Google, Netflix and Meta
How to get things done - Lessons from Yahoo, Google, Netflix and Meta
 
Crypto 101 and a bit more [Sep-2022]
Crypto 101 and a bit more [Sep-2022]Crypto 101 and a bit more [Sep-2022]
Crypto 101 and a bit more [Sep-2022]
 
The Future of Continuous Software Updates Is Here
The Future of Continuous Software Updates Is HereThe Future of Continuous Software Updates Is Here
The Future of Continuous Software Updates Is Here
 
Open Source & DevOps Market trends - Open Core Summit
Open Source & DevOps Market trends - Open Core SummitOpen Source & DevOps Market trends - Open Core Summit
Open Source & DevOps Market trends - Open Core Summit
 
DevOps as a competitive advantage
DevOps as a competitive advantageDevOps as a competitive advantage
DevOps as a competitive advantage
 
Data Driven DevOps & Technologies (swampUP 2019 keynote)
Data Driven DevOps & Technologies (swampUP 2019 keynote)Data Driven DevOps & Technologies (swampUP 2019 keynote)
Data Driven DevOps & Technologies (swampUP 2019 keynote)
 
Create An Amazing Apps For The Google Assistant!
Create An Amazing Apps For The Google Assistant!Create An Amazing Apps For The Google Assistant!
Create An Amazing Apps For The Google Assistant!
 
VUI Design
VUI DesignVUI Design
VUI Design
 
Google Assistant - Why? How?
Google Assistant - Why? How?Google Assistant - Why? How?
Google Assistant - Why? How?
 
The Google Assistant - Macro View (October 2017)
The Google Assistant - Macro View (October 2017)The Google Assistant - Macro View (October 2017)
The Google Assistant - Macro View (October 2017)
 
Actions On Google - GDD Europe 2017
Actions On Google - GDD Europe 2017Actions On Google - GDD Europe 2017
Actions On Google - GDD Europe 2017
 
Building conversational experiences with Actions on Google
Building conversational experiences with Actions on GoogleBuilding conversational experiences with Actions on Google
Building conversational experiences with Actions on Google
 
Actions On Google - How? Why?
Actions On Google - How? Why?Actions On Google - How? Why?
Actions On Google - How? Why?
 
Startups Best Practices
Startups Best PracticesStartups Best Practices
Startups Best Practices
 
Progressive Web Apps For Startups
Progressive Web Apps For StartupsProgressive Web Apps For Startups
Progressive Web Apps For Startups
 
Earn More Revenue With Firebase and AdMob
Earn More Revenue With Firebase and AdMobEarn More Revenue With Firebase and AdMob
Earn More Revenue With Firebase and AdMob
 
How To Grow Your User Base?
How To Grow Your User Base?How To Grow Your User Base?
How To Grow Your User Base?
 
Amp Overview #YGLF 2016
Amp Overview #YGLF 2016Amp Overview #YGLF 2016
Amp Overview #YGLF 2016
 
AMP - Accelerated Mobile Pages
AMP - Accelerated Mobile PagesAMP - Accelerated Mobile Pages
AMP - Accelerated Mobile Pages
 
From AMP to PWA
From AMP to PWAFrom AMP to PWA
From AMP to PWA
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Memcache basics on google app engine

  • 2. App Engine: Memcache Basics Who? Why? Ido Green Solutions Architect plus.google.com/greenido greenido.wordpress.com
  • 3. App Engine: Memcache Basics Topics We Cover in This Lesson ● What is Memcache? ● Why do we need Memcache? ● How to Use Memcache? ● Caveats And Solutions
  • 4. App Engine: Memcache Basics What Is Memcache?
  • 5. What is Memcache? What is Memcache? ● Memcache is an in-memory Key-Value Pairs data store ○ Put a value with a key ○ Get a value with a key value key "user001" : "John Doe" "user002" : "Larry Page" ● key or value can be anything that is serializable ● Memcache is a shared service accessed via App Engine APIs.
  • 6. What Is Memcache What Do We Use Memcache For? ● ● ● Caching In Front of Datastore ○ Cache entities for low-latency reads ○ Integrated into most ORM frameworks (ndb, Obectify ..) Caching for Read heavy operations ○ User authentication token and session data ○ APIs call or other computation results Semi-durable Shared state Cross App Instances ○ Sessions ○ Counters / Metrics ○ Application Configurations
  • 7. App Engine: Memcache Basics Why Do We Need Memcache?
  • 8. Why do we need Memcache? Why Do We Use Memcache? ● Improve Application Performance ● Reduce Application Cost
  • 9. Why do we need Memcache? How Fast Can Memcache be? And How Much? Datastore Query Latency Memcache Read Latency
  • 10. How to Use Memcache
  • 11. How to Use Memcache Memcache APIs ● Java ○ JCache APIs ○ GAE Low-Level Memcache APIs ○ Objectify for Datastore ● Python ○ google.appengine.api.memcache module ○ ndb for Datastore
  • 12. How to Use Memcache General Memcache Usage Pattern Coordinate data read with Datastore: ● Check if Memcache value exists ○ if it does, display/use cached value directly; otherwise ○ fetch the value from Datastore and write the value to Memcache Coordinate data write with Datastore: ● Update Memcache value ○ to handle race condition, leverage put if untouched/compare and set to detect race conditions ● Write the value to Datastore ○ optionally, leverage the task queue for background writes
  • 13. How to Use Memcache Using GAE Client Library (Java) import com.google.appengine.api.memcache; ... MemcacheService syncCache = MemcacheServiceFactory. getMemcacheService(); // Act on error as cache miss syncCache.setErrorHandler(ErrorHandlers. getConsistentLogAndContinue(Level.INFO)); value = (byte[]) syncCache.get(key); // read from cache if (value == null) { value = getDataFromDb(key); // fetch value from datastore syncCache.put(key, value); // write to cache // (key and value must be serializable) } ...
  • 14. How to Use Memcache Using GAE Client Library (Python) from google.appengine.api import memcache ... value = memcache.get(key) if value is None: value = get_value_from_db(key) if not memcache.add(key, value): logging.error('Memcache add failed.') ...
  • 15. How to Use Memcache Batch Operations ● getAll(), putAll(), deleteAll() A single read or write operation for multiple memcache entries Note ● Further improve Memcache performance by reducing network traffics ● Batch size < 32 MB
  • 16. How to Use Memcache Atomic Operations ● increment(key, delta), incrementAll(...), Provide atomic increment of numeric value(s) ● getIdentifiable(), putIfUntouched() in Java, or cas() in Python A mechanism to update a value consistently by concurrent requests Note ● Helps managing memcache data consistency in multi-instances/concurrent environment
  • 17. How to Use Memcache Some Other Features ● Asynchronous calls Provides a mechanism to make a non-blocking call for memcache operations ● Namespace Logically separates data layers for different application purposes (like multi tenancy) across many GAE services such as Datastore, Memcache, Task Queue etc...
  • 19. Caveats And Solutions Caveat: Memcache Is Volatile Entries can be evicted anytime by various reasons: ● ● ● entry reaches expiration entry is evicted because memcache memory is full memcache server fails Tip ● It's important to handle cache-miss gracefully! ● Implements write-through logic by backing memcache with datastore in your application! ○ Psst... Objectify and ndb do it for you.
  • 20. Caveats And Solutions Caveat: Memcache Is Not Transactional Instance 1 reads $100 $100 $100 Instance 2 reads $100 $100 $100 Instance 2 deducts $20 $80 $80 Instance 1 deducts $30 $70 $70 Tip Using getIdentifiable() and putIfUntouched(...) for optimistic locking
  • 21. Caveats And Solutions Caveat: Memcache Is A Limited Resource My Application Does NOT Have Enough Memcache! Tips ● Only need to cache what is useful and necessary! ● Your application should function without memcache! ● Dedicated Memcache
  • 22. Caveats And Solutions Dedicated Memcache Enabling dedicated memcache from the admin console 1. Provides fixed cache capacity that is exclusive to your application 2. Billed by the GB per hour of cache size. Charged in 15 minute increments 3. Gives you additional control over cache size. More predictable performance Note: Whether shared or dedicated, Memcache is not a durable storage. Plan for your application to function without Memcache
  • 23. Discussion And Questions Key Takeaways 1. Memcache is supported natively in GAE. Take advantage of it to improve your GAE application performance. 2. Memcache supports open standard JCache API. Many advanced features are available by GAE Memcache APIs to suit your application's need i.e. Batch, Atomic, Asynchronous operations 3. Seamless integration with GAE Datastore in a few libraries like Python ndb and Java Objectify. 4. Read-frequently and write-rarely data is most suitable in combining with Memcache 5. Handle Memcache's volatility in your application 6. Use Memcache wisely, it is not an unlimited resource
  • 24. App Engine: Memcache Basics Thank you! Questions?