SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Strategies for maintaining
during read-only periods


            Jason Cooper
      Google Developer Programs
      jasonacooper@google.com
             April 6, 2010
Strategies

  Capabilities API
  Exception handling
  Read-only versions
Strategies

  Capabilities API
  Exception handling
  Read-only versions
Capabilities API - datastore

is_enabled method can be used to test whether a certain
capability is currently enabled.

datastore_writes = CapabilitySet(
  'datastore_v3',
  capabilities=['write'])

if not datastore_writes.is_enabled():
  # ...render form with form elements disabled
  # or, if a form is submitted, push a new task
  # to the task queue
else:
  # ...render form normally
Capabilities API - datastore

will_remain_enabled_for method can be used to learn whether
a component will be disabled within a certain number of
seconds

datastore_writes = CapabilitySet(
  'datastore_v3',
  capabilities=['write'])

if datastore_writes.will_remain_enabled_for(60):
  # ...render form normally
else:
  # ...render form with form elements disabled
Capabilities API - memcache

The capabilities API can be used with other services including
memcache...

memcache_set = CapabilitySet(
  'memcache',
  methods=['set'])

if memcache_set.is_enabled():
  # ...fetch from cache
else:
  # ...bypass cache
Capabilities API - images

... as well as the Images service.

images_capability = CapabilitySet('images')

if images_capability.is_enabled():
  my_image = images.resize(my_image, 64, 64)
Capabilities API

Pros:
   Automated -- no changes needed when read-only mode
   begins or ends
   Allows for datastore writes to be "deferred" by pushing a
   new task to the task queue instead of writing immediately;
   the task will be continually re-tried until the task succeeds,
   so the write should occur eventually.

Cons:
  Python-only (for now)
  Undocumented (for now)
      see google/appengine/api/capabilities SDK directory
Strategies

  Capabilities API
  Exception handling
  Read-only versions
Exception handling - Python

Python:
http://code.google.com/appengine/docs/python/howto/maintenance.html


from google.appengine.ext import db
import google.appengine.runtime.apiproxy_errors

myModel = db.Model()
try:
  myModel.put()
except apiproxy_errors.CapabilityDisabledError:
  # fail gracefully here or add a new task to the
  # task queue that writes the new entity when
  # the datastore is available
Datastore exception handling - Java

Java:
http://code.google.com/appengine/docs/java/howto/maintenance.html


import com.google.apphosting.api.ApiProxy.CapabilityDisabledException;


try {
  // JDO: pm.makePersistent(entity);
  // JPA: em.persist(entity);
  // low-level: ds.put(entity);
} catch (CapabilityDisabledException e) {
  // fail gracefully here
} finally {
  // ...
}
Memcache exception handling - Java

Java:
http://code.google.com/appengine/docs/java/howto/maintenance.html


As with Python, memcache is unavailable during read-only
mode and exceptions aren't thrown by default.

You can use a StrictErrorHandler if you want an exception
thrown when get and put aren't available.
Memcache exception handling - Java

Java:
http://code.google.com/appengine/docs/java/howto/maintenance.html


import com.google.appengine.api.memcache.MemcacheServiceException;


// ...
ms.setErrorHandler(new StrictErrorHandler());

try {
  ms.put(key, value);
} catch (MemcacheServiceException e) {
  // degrade gracefully
}
Exception handling

Pros:
   Automated -- no changes needed when read-only mode
   begins or ends
   Allows for datastore writes to be "deferred" by pushing a
   new task to the task queue instead of writing immediately;
   the task will be continually re-tried until the task succeeds,
   so the write should occur eventually.

Cons:
  Reactive -- exception is caught only after the read or write
  call is processed, unlike the first solution.
  Complicates code slightly -- the exception needs to be
  caught for every write attempt.
Note on using tasks to defer writes

The task queue allows you defer writes when the datastore is
unavailable -- you can add a new task instead, which the
system will automatically retry in the background until it
succeeds.

If you choose this approach, keep the following in mind:

   The number of tasks that you can add per day is currently
   limited to 1,000,000. If your app receives a lot of write traffic
   (e.g. > 350 QPS), you could exceed this quota unless the
   period of unavailability is short.
   Consider adding a timestamp field to your entities plus extra
   logic so you don't accidentally overwrite a later update when
   the tasks are applied.
Strategies

  Capabilities API
  Exception handling
  Read-only versions
Read-only versions

                       http://fredsa.appspot.com/


                                Version
                                  1.1

             App
            Engine                                     Datastore
  Use
   r       Frontend



                                Version
                                  2.1

                      http://2.1.fredsa.appspot.com/
Read-only versions

Python: app.yaml


application: helloworld
version: readonly
runtime: python
api_version: 1

handlers:
- url: .*
  script: main.py
Read-only versions

Java: appengine-web.xml


<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app>
 <application>helloworld</application>
 <version>readonly</version>

 <!-- ... -->
</appengine-web-app>
Read-only versions

Pros:
   Proactive -- e.g. users see a grayed-out form instead of an
   error on save

Cons:
  Manual -- it's your responsibility to be aware of and switch
  versions before read-only mode starts and after it ends
  Only useful for planned downtimes -- unless other mitigation
  strategies are in place, your app will still go down during
  unplanned downtimes.
  Maintenance
Thanks!



      Jason Cooper
Google Developer Programs
jasonacooper@google.com
       April 6, 2010

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Eclipse - Single Source;Three Runtimes
Eclipse - Single Source;Three RuntimesEclipse - Single Source;Three Runtimes
Eclipse - Single Source;Three Runtimes
 
Java applets and working principles
Java applets and working principlesJava applets and working principles
Java applets and working principles
 
applet using java
applet using javaapplet using java
applet using java
 
Arjuna - The Case of Web UI Automation with Selenium
Arjuna - The Case of Web UI Automation with SeleniumArjuna - The Case of Web UI Automation with Selenium
Arjuna - The Case of Web UI Automation with Selenium
 
Java applets
Java appletsJava applets
Java applets
 
Java Applet
Java AppletJava Applet
Java Applet
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Java applet
Java appletJava applet
Java applet
 
VivaMP - a tool for OpenMP
VivaMP - a tool for OpenMPVivaMP - a tool for OpenMP
VivaMP - a tool for OpenMP
 
Gradle Again
Gradle AgainGradle Again
Gradle Again
 
Applets
AppletsApplets
Applets
 
Java Applet
Java AppletJava Applet
Java Applet
 
Jsp applet
Jsp appletJsp applet
Jsp applet
 
Applet programming in java
Applet programming in javaApplet programming in java
Applet programming in java
 
Automation With Appium
Automation With AppiumAutomation With Appium
Automation With Appium
 
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Appium troubleshooting
Appium troubleshootingAppium troubleshooting
Appium troubleshooting
 
BCS Selenium Workshop
BCS Selenium WorkshopBCS Selenium Workshop
BCS Selenium Workshop
 
Api desgin
Api desginApi desgin
Api desgin
 

Andere mochten auch

Lymphatic And Immune Systems by Myrtle Acree
Lymphatic And Immune Systems by Myrtle AcreeLymphatic And Immune Systems by Myrtle Acree
Lymphatic And Immune Systems by Myrtle Acree
Myrtle Acree
 
App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)
jasonacooper
 
App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)
jasonacooper
 
Woolpresentation
WoolpresentationWoolpresentation
Woolpresentation
guestc95402
 
当当网:从搜索到发现
当当网:从搜索到发现当当网:从搜索到发现
当当网:从搜索到发现
biaodianfu
 

Andere mochten auch (18)

Stickiness Of Training V4 3 (2)
Stickiness Of Training V4 3 (2)Stickiness Of Training V4 3 (2)
Stickiness Of Training V4 3 (2)
 
Joy of Conversation
Joy of ConversationJoy of Conversation
Joy of Conversation
 
The Wide World Of Google Developer Technologies (STLIC 02-10)
The Wide World Of Google Developer Technologies (STLIC 02-10)The Wide World Of Google Developer Technologies (STLIC 02-10)
The Wide World Of Google Developer Technologies (STLIC 02-10)
 
Mind the Gap
Mind the GapMind the Gap
Mind the Gap
 
Scale of the MTA: Passenger Count
Scale of the MTA: Passenger CountScale of the MTA: Passenger Count
Scale of the MTA: Passenger Count
 
Lymphatic And Immune Systems by Myrtle Acree
Lymphatic And Immune Systems by Myrtle AcreeLymphatic And Immune Systems by Myrtle Acree
Lymphatic And Immune Systems by Myrtle Acree
 
App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)
 
Crisp about motivation
Crisp about motivationCrisp about motivation
Crisp about motivation
 
Fqm Brochure
Fqm BrochureFqm Brochure
Fqm Brochure
 
App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)
 
Motivation
MotivationMotivation
Motivation
 
The making of pop cap's plants vs zombies
The making of pop cap's plants vs zombiesThe making of pop cap's plants vs zombies
The making of pop cap's plants vs zombies
 
Woolpresentation
WoolpresentationWoolpresentation
Woolpresentation
 
F & B control
F & B controlF & B control
F & B control
 
Menu analysis engineering382
Menu analysis engineering382Menu analysis engineering382
Menu analysis engineering382
 
Customer care for h.k
Customer care for h.kCustomer care for h.k
Customer care for h.k
 
当当网:从搜索到发现
当当网:从搜索到发现当当网:从搜索到发现
当当网:从搜索到发现
 
当当网 从搜索到发现
当当网 从搜索到发现当当网 从搜索到发现
当当网 从搜索到发现
 

Ähnlich wie Strategies For Maintaining App Engine Availability During Read Only Periods

Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performance
Abhishek Sur
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 

Ähnlich wie Strategies For Maintaining App Engine Availability During Read Only Periods (20)

Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
Marathon Testing Tool
Marathon Testing ToolMarathon Testing Tool
Marathon Testing Tool
 
Automation using ibm rft
Automation using ibm rftAutomation using ibm rft
Automation using ibm rft
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017
 
Mykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with JmeterMykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with Jmeter
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
 
inline function
inline functioninline function
inline function
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Drupal development
Drupal development Drupal development
Drupal development
 
Extent Test report v3 with Appium/Selenium
Extent Test report v3 with Appium/SeleniumExtent Test report v3 with Appium/Selenium
Extent Test report v3 with Appium/Selenium
 
B4usolution performance testing
B4usolution performance testingB4usolution performance testing
B4usolution performance testing
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP
 
Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performance
 
How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react
 
Node.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniquesNode.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniques
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
Lesson 4
Lesson 4Lesson 4
Lesson 4
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+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@
 

Kürzlich hochgeladen (20)

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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+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...
 

Strategies For Maintaining App Engine Availability During Read Only Periods

  • 1. Strategies for maintaining during read-only periods Jason Cooper Google Developer Programs jasonacooper@google.com April 6, 2010
  • 2. Strategies Capabilities API Exception handling Read-only versions
  • 3. Strategies Capabilities API Exception handling Read-only versions
  • 4. Capabilities API - datastore is_enabled method can be used to test whether a certain capability is currently enabled. datastore_writes = CapabilitySet( 'datastore_v3', capabilities=['write']) if not datastore_writes.is_enabled(): # ...render form with form elements disabled # or, if a form is submitted, push a new task # to the task queue else: # ...render form normally
  • 5. Capabilities API - datastore will_remain_enabled_for method can be used to learn whether a component will be disabled within a certain number of seconds datastore_writes = CapabilitySet( 'datastore_v3', capabilities=['write']) if datastore_writes.will_remain_enabled_for(60): # ...render form normally else: # ...render form with form elements disabled
  • 6. Capabilities API - memcache The capabilities API can be used with other services including memcache... memcache_set = CapabilitySet( 'memcache', methods=['set']) if memcache_set.is_enabled(): # ...fetch from cache else: # ...bypass cache
  • 7. Capabilities API - images ... as well as the Images service. images_capability = CapabilitySet('images') if images_capability.is_enabled(): my_image = images.resize(my_image, 64, 64)
  • 8. Capabilities API Pros: Automated -- no changes needed when read-only mode begins or ends Allows for datastore writes to be "deferred" by pushing a new task to the task queue instead of writing immediately; the task will be continually re-tried until the task succeeds, so the write should occur eventually. Cons: Python-only (for now) Undocumented (for now) see google/appengine/api/capabilities SDK directory
  • 9. Strategies Capabilities API Exception handling Read-only versions
  • 10. Exception handling - Python Python: http://code.google.com/appengine/docs/python/howto/maintenance.html from google.appengine.ext import db import google.appengine.runtime.apiproxy_errors myModel = db.Model() try: myModel.put() except apiproxy_errors.CapabilityDisabledError: # fail gracefully here or add a new task to the # task queue that writes the new entity when # the datastore is available
  • 11. Datastore exception handling - Java Java: http://code.google.com/appengine/docs/java/howto/maintenance.html import com.google.apphosting.api.ApiProxy.CapabilityDisabledException; try { // JDO: pm.makePersistent(entity); // JPA: em.persist(entity); // low-level: ds.put(entity); } catch (CapabilityDisabledException e) { // fail gracefully here } finally { // ... }
  • 12. Memcache exception handling - Java Java: http://code.google.com/appengine/docs/java/howto/maintenance.html As with Python, memcache is unavailable during read-only mode and exceptions aren't thrown by default. You can use a StrictErrorHandler if you want an exception thrown when get and put aren't available.
  • 13. Memcache exception handling - Java Java: http://code.google.com/appengine/docs/java/howto/maintenance.html import com.google.appengine.api.memcache.MemcacheServiceException; // ... ms.setErrorHandler(new StrictErrorHandler()); try { ms.put(key, value); } catch (MemcacheServiceException e) { // degrade gracefully }
  • 14. Exception handling Pros: Automated -- no changes needed when read-only mode begins or ends Allows for datastore writes to be "deferred" by pushing a new task to the task queue instead of writing immediately; the task will be continually re-tried until the task succeeds, so the write should occur eventually. Cons: Reactive -- exception is caught only after the read or write call is processed, unlike the first solution. Complicates code slightly -- the exception needs to be caught for every write attempt.
  • 15. Note on using tasks to defer writes The task queue allows you defer writes when the datastore is unavailable -- you can add a new task instead, which the system will automatically retry in the background until it succeeds. If you choose this approach, keep the following in mind: The number of tasks that you can add per day is currently limited to 1,000,000. If your app receives a lot of write traffic (e.g. > 350 QPS), you could exceed this quota unless the period of unavailability is short. Consider adding a timestamp field to your entities plus extra logic so you don't accidentally overwrite a later update when the tasks are applied.
  • 16. Strategies Capabilities API Exception handling Read-only versions
  • 17. Read-only versions http://fredsa.appspot.com/ Version 1.1 App Engine Datastore Use r Frontend Version 2.1 http://2.1.fredsa.appspot.com/
  • 18. Read-only versions Python: app.yaml application: helloworld version: readonly runtime: python api_version: 1 handlers: - url: .* script: main.py
  • 19. Read-only versions Java: appengine-web.xml <?xml version="1.0" encoding="utf-8"?> <appengine-web-app> <application>helloworld</application> <version>readonly</version> <!-- ... --> </appengine-web-app>
  • 20. Read-only versions Pros: Proactive -- e.g. users see a grayed-out form instead of an error on save Cons: Manual -- it's your responsibility to be aware of and switch versions before read-only mode starts and after it ends Only useful for planned downtimes -- unless other mitigation strategies are in place, your app will still go down during unplanned downtimes. Maintenance
  • 21. Thanks! Jason Cooper Google Developer Programs jasonacooper@google.com April 6, 2010