0% found this document useful (0 votes)
36 views5 pages

Google App Engine Development Insights

This document discusses Google App Engine, a cloud computing platform that allows developers to build and deploy applications without having to manage servers or infrastructure. It offers tools for local development and testing, and uses a web-based dashboard for management after deployment. The platform automatically scales computing resources based on application needs. It also discusses predictive models, databases, performance measurement, and best practices for scaling applications on Google App Engine to handle high loads.

Uploaded by

Dinesh Mudiraj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views5 pages

Google App Engine Development Insights

This document discusses Google App Engine, a cloud computing platform that allows developers to build and deploy applications without having to manage servers or infrastructure. It offers tools for local development and testing, and uses a web-based dashboard for management after deployment. The platform automatically scales computing resources based on application needs. It also discusses predictive models, databases, performance measurement, and best practices for scaling applications on Google App Engine to handle high loads.

Uploaded by

Dinesh Mudiraj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Google App Engine

Name-Rajan Kumar

Abstract—Google App Engine is a cloud computing platform for Online predictive deploys ML models with server less, fully
developing web-based applications. With this tool developers are managed hosting that responds in real time with high
able to code applications without worrying about server availability. Our global prediction platform automatically scales
management or hardware configurations because this is managed to adjust to any throughput. It provides a secure web endpoint to
by the engine. The Google App Engine Development Kit offers
integrate ML into your applications.
tools for developing and testing the en-tire application locally.
Once you’ve developed the application, Google App Engine Batch Predictive offers cost-effective inference with
provides a management tool which gives the control of your unparalleled throughput for asynchronous applications. It scales
application using a simple web-based dashboard. It also scales to perform inference on TBs of production data.
automatically all the computing resources that your application
may need. GAE is free to use until your application reach a Database
certain amount of resources use. After reaching this amount, if
you plain to scale your application resources, you must pay for App Engine's [7] Python standard runtime connects to Cloud
the re-sources used. In this paper we show the installation and Datastore using the NDB client library. The NDB Client Library
basic configurations procedures to obtain the best of this cloud provides persistent storage in a seamless object datastore. It
computing platform.
supports automatic caching, sophisticated queries, and atomic
transactions.
You cannot use the Cloud Datastore client with Python
Keyword—cloud computing, Predictive models, Database, Current
measurement, Delays.
applications in the App Engine standard environment. Cloud
Datastore is a NoSQL document database built for automatic
scaling, high performance, and ease of application development.
Cloud Datastore features include
I. INTRODUCTION :
Atomic transactions. Cloud Datastore can execute a set of
This document is a final report from my summer 2019 operations where either all succeed, or none occur.
distributed research experience as an undergraduate student. High availability of reads and writes. Cloud Datastore runs in
My mentor, Pawandeep Kaur, Ph. D, from the Dept. of Google data centres, which use redundancy to minimize impact
Computer Science at the Lovely Professional University of from points of failure.
Punjab, directed my effort in this research. According to the Massive scalability with high performance. Cloud Datastore
National Institute of Standards and Technology (NIST) the uses a distributed architecture to automatically manage scaling.
Cloud Computing definition is[5] "a model for enabling Cloud Datastore uses a mix of indexes and query constraints so
convenient, on-demand network access to a shared pool of your queries scale with the size of your result set, not the size of
configurable computing resources (e.g., networks, servers, your data set.
storage, applications, and services)that can be rapidly Flexible storage and querying of data. Cloud Datastore maps
provisioned and released with minimal management effort or naturally to object-oriented and scripting languages, and is
service provider interaction. This cloud model promotes exposed to applications through multiple clients. It also provides
availability”. Everyday many IT companies are founded, some a SQL-like query language.
of these companies are small companies trying to success Balance of strong and eventual consistency. Cloud Datastore
beginning from zero and they are called startups. The best way ensures that entity lookups by key and ancestor queries always
to do this is to decrease operating costs which are responsible receive strongly consistent data. All other queries are eventually
for many companies failure. Google App Engine (GAE) is a consistent. The consistency models allow your application to
development platform that helps those companies to start. deliver a great user experience while handling large amounts of
Build and deploy applications on a fully managed platform. data and users.
Scale your applications seamlessly from zero to planet scale
without having to worry about managing the underlying Measurement
infrastructure. With zero server management and zero
configuration deployments, developers can focus only on App Engine is a scalable system which will automatically add
building great applications without the management overhead. more capacity as workloads increase.
Here are some best practices to ensure that your app will scale to
II. EASE OF USE high load.
Predictive models Run load tests
If you are expecting high traffic, we strongly recommend that
Predictive incorporates intelligence into your applications and you run load tests to reduce the risk of hitting a bottleneck in
workflows. Once you have a trained model, prediction applies your code or in App Engine.
what the computer learned to new examples. ML Engine Your tests should be designed to simulate real world traffic as
offers two types of prediction: closely as possible. You should test at the maximum load that
you expect to encounter. In order to accurately assess demand,
you can run a 1% test to determine how much traffic will flow time to spin up enough instances to handle all traffic. During
to your new service. this period, requests can potentially sit on the pending queue and
In addition, some applications will get a sudden increase in can time out.
load, and you will need to predict the rate of increase. If you Therefore, in order to minimize latency and errors, we
are expecting spikey load, you should also test how your recommend that customers use traffic migration or traffic
application performs when traffic suddenly increases. splitting to move traffic gradually to a new version before
We also recommend that you test under various scenarios. For making it the default.
example, what happens if your application moves to a new An application can serve requests from both versions while you
datacentre, causing a Memcache flush and all instances to be are moving traffic to the new version. In most cases, this will
stopped and restarted? In the Google Cloud Platform Console, not cause any problems. However, if you have an
you can flush Memcache and stop all instances to simulate incompatibility in the cached objects used by an application then
this. In addition to measuring performance during load tests, you will need to ensure that users go to the same version of an
you should also measure the increase in cost as the number of application during their session. You will need to code this into
users of your service increases. your application logic.
You should allow sufficient time in your schedule to resolve Do not exceed Memcache rated operations per second
problems that might arise in load testing. You can use Dedicated Memcache in order to get guaranteed
Do not set a spending limit that could be exceeded. You can capacity and more consistent performance. You must ensure that
configure a daily spending limit for your application if you are you do not exceed the rated operations per second.
paying online. You can view the spending limit in the GCP The rated operations per second of Dedicated Memcache are
Console. Your application will serve errors if your spending disproportionately lower for items larger than 1 KB. One
limit is exceeded, so ensure that your limit is sufficient to strategy for reducing item size is to compress large values
handle the maximum possible daily usage. You should not before storing in Memcache.
wait until the last minute to try to increase your spending Note that the Memcache graphs in the App Engine Admin
limit, because Google needs an approval from your credit card Console dashboard show average operations per second
issuer. If there are problems getting this approval then your aggregated over a time period. Thus these graphs might not
spending limit increase will be delayed. Ensure that you will show very short term spikes in usage, which could impact
not hit quota limits on API calls performance.
Some API calls have per-minute and per-day quota limits in If your load is unevenly distributed across the Memcache
order to prevent a single application from using up more than keyspace then you might not see the expected performance from
its share of available resources. In the GCP Console, you Dedicated Memcache. Avoid Memcache hot keys. Hot keys are
can view your quota details for all API calls. You will get a a common anti-pattern that can cause Memcache capacity to be
quota denied error if you exceed quota limits. APIs that are exceeded.
not yet generally available are usually subject to strict quota For Dedicated Memcache, we recommend that the peak access
limits. rate on a single key should be 1-2 orders of magnitude less than
In addition, there are some APIs that have relatively strict the per-GB rating. For example, the rating for 1 KB sized items
quotas, despite being generally available. APIs in this is 10,000 operations per second per GB of Dedicated
category include URL Fetch, and Socket. If you are using Memcache. Therefore, the load on a single key should not be
these APIs, you should pay particular attention to quota limits. higher than 100 - 1,000 operations per second for items that are
The per-minute quota limits are not shown in the GCP 1 KB in size. Memcache hashes keys so that keys that are
Console. Your application will not hit a per-minute quota lexicographically close will not cause hotspots.
unless you have an unexpected usage pattern. Load testing can In load tests, you might see better performance. However, you
be used to determine whether you would hit a per-minute should design your code so that it complies with the published
quota limit. ratings because the performance of Dedicated Memcache can
Shard task queues if high throughput is needed change.
You can share task queues if you want higher throughput than The GCP Console displays Memcache hot keys. Here are some
is possible with a single queue. Your application should not strategies for reducing the operations per second on frequently-
depend on tasks executing immediately after creation so that used keys: Organize data per user so that a single HTTP request
you can handle a short term backlog in the task queues only hits that user's data. Avoid storing global data which must
without affecting the experience of your end users. be accessed from all HTTP requests. Cache frequently-used
Using performance settings keys in your instances global memory not in Memcache. Note
You can use several settings in the application configuration that you would lose the consistency of Memcache if you stored
file to adjust the trade-off between performance and resource data in instance memory, because one instance might have
load for a specific version of your app. For a list of the different data than another.
available auto-scaling settings, see scaling elements section of
the application configuration file for Python, Java, Go, PHP. Test third-party dependencies
Use traffic migration or splitting when switching to a new
default version If you depend on a system outside App Engine for handling
A high traffic application might get errors or higher latency requests then you should ensure that this system has been tested
when updating to a new version in the following scenarios: to handle high load. For example, if you are using URL Fetch to
Complete update of a new default version get data from a third-party web server then you can determine
Set the default version the impact of various load testing scenarios on the third party
Once the update is complete, App Engine will send requests to web server's throughput and latency.
the new version. However, the new version can take some Implement back off on retry
Your code can retry on failure, whether calling a service such different method to push updates to clients, such as Websockets.
as Cloud Datastore or an external service using URL Fetch or However, Websockets cannot be implemented on App Engine,
the Socket API. However, your client code should protect so would require some additional complexity in your
against situations in which the remote service is overloaded. A implementation [7].
high rate of retries can cause the service to recover more
slowly. Delays
Google recommends using an approach in which the client
caps the amount of outgoing traffic if it detects that a Task Queue is usually used to execute background task, where
significant proportion of requests are failing with server-side you can even setup Crone Jobs.
errors. The Adaptive Throttling algorithm is fully described in But if you have a small task which you intent to run in
the SRE books. Google's gRPC client libraries implement background after each request, do consider using deffered.
a variation of the Adaptive Throttling Algorithm. You should Sample use cases are:
also implement back off on retry on automated clients that call
your App Engine application. Understand how costs change as Send email or sms after each request (avoid blocking the
usage of your service increases request)
During the initial design of a new service, the developers can Post for FB/Twitter after 5 minutes delay (allow user window to
choose to trade-off the efficiency of their code for reduced make edits)
complexity, in order to build features more quickly. However, The following code will execute defer post in background after
this trade-off might lead to significantly higher costs, if the the request complete.[6]
service gets a significant increase in usage.
Below are some examples of ways in which you can reduce
costs by making changes in your application's design. This list
is by-no-means exhaustive, but it reflects the experiences of
some App Engine customers who have had significant
increases in traffic.

Inefficient use of APIs

App Engine's backend services, such as Memcache and Cloud


Datastore, will generally scale, even if you use these APIs
inefficiently. But you would be reducing performance and
increasing costs. The additional costs can be significant for
some applications. The tips below can also apply when calling
a third party API from your application.
Use asynchronous API calls, when available, so that your
application can do other work while waiting for the call to
return.
Set an API call deadline, when possible, so that your
application is not blocked indefinitely if there is a spike in Features
latency. Avoid nook writes to storage systems, such as
Memcache or Datastore. These will increase latency, and in You can use Go, Java, PHP, or Python to write an app engine
the case of Datastore, also increase costs. You should refactor application. You can develop and test an app locally using the
your code if you are doing this. SDK containing tools for deploying apps. Every language has its
Consider using batch API calls, when available, that can offer own SDK and runtime. Your code is executed in a:
improvements in performance. You should ensure that you  Java 7 environment by Java runtime
eliminate duplicate calls from a batch, in order to avoid  Python 2.7 environment by Python runtime
unnecessary work.  PHP 5.4 environment by PHP runtime
Tasks name are unique per queue. You can ensure that you are  Go 1.2 environment by Go runtime
not creating duplicate tasks, by setting a meaningful task
name. These mainly focused on the depreciation policy and the
Avoid unnecessary indexed fields for your Datastore kinds service-level agreement of the Google app engine. If any
which adds additional costs. It might be more cost efficient to changes made to such a feature are backward-compatible and
run a Map reduce job to create your own index, than to update implementation of such a feature is usually stable which makes
the indexed fields on each write. the search more efficient and well flexible. These include data
Polling storage, retrieval, and search; communications; process
You can implement polling in various scenarios. For example: management; computation; app configuration and management.
Mobile clients poll your application for updates. Data storage, retrieval, and search include features such as HRD
Your application makes API calls to third party sites to get migration tool, Google Cloud SQL, logs, data store, dedicated
updated information on each user in your system. Memcache, blobstore, Memcache and search.
In many cases, the polling requests consume resources Communications include features such as XMPP. channel, URL
unnecessarily, because there has been no change to the user's fetch, mail, and Google Cloud Endpoints.
data. You can poll less frequently in order to reduce costs, but Process management includes features like scheduled tasks and
that can lead to reduced freshness. Instead, you can use a task queue Computation includes images.
App management and configuration cover app identity, users, Conclusion
capabilities, traffic splitting, modules, SSL for custom
domains, modules, remote access, and multitenancy. Google App Engine enables you to build web applications for
your business leveraging Google’s infrastructure.
App Engine applications are easy to develop, maintain, and can
Advantages scale as your traffic and data storage needs grow. With App
Engine, you don’t end up paying for large server spaces and
 High Infrastructure for the security then spend on resources maintaining them. You just upload your
application, and it’s ready to serve to your users. Rest is taken
This made users more comfortable while using on network as care by Google Cloud.
a service. In world, the Internet infrastructure that Google has
is probably the most secure. There is more rarely any type of
unauthorized access till date as the application data and code
are stored in highly secure servers.
You can be sure that your app will be available to users
worldwide at all times since Google has several hundred
servers globally. Google’s security and privacy policies are
applicable to the apps developed using Google’s Reference—
infrastructure.
[1]ApacheAntdownloads
 Data Scalability .[Link]
[Link]
For any app’s success, this is among the deciding factors that [2] G. Developers. Getting started: Java. (24), April 2012. [On-
it will work in real life last long or not. Google creates its own line;accessed22March2012].[Link]
apps using GFS, Big Table and other such technologies, ngine/docs/java/getting-started/installing
which are available to you when you utilize the Google app
engine to create apps. You only have to write the code for the [3] G. Developers. What is google app engine. (26), June
app and Google looks after the testing on account of the 2012.[Online; accessed 23-March-
automatic scaling feature that the app engine has. Regardless 2012].[Link]
of the amount of data or number of users that your app stores, gle-appengine
the app engine can meet your needs by scaling up or down as
required. [4] T. A. A. S. Foundation. Apache ant 1.8.3 manual.1-July-
[2012]. [Link]
 Performance and Reliability [5] N. I. of Standards and Technology. The Nist definition of
cloud computing. January 2011.
Google is among the leaders worldwide among global brands. [4] T. A. A. S. Foundation. Apache ant 1.8.3 manual. [Online;
So, when you discuss performance and reliability you have to accessed 1-July-2012].
keep that in mind. In the past 15 years, the company has <[Link]
created new benchmarks based on its services’ and products’ [5] N. I. of Standards and Technology. The NIST definition of
performance. The app engine provides the same reliability and cloud-computing. January 2011.
performance as any other Google product. <[Link]
[6] AKASH LOMAS, Engineering
 Cost Savings and Platform Independence [Link]
ueue/push/creating-
You don’t have to hire engineers to manage your servers or to tasks#using_the_deferred_instead_of_a_worker_service
do that yourself. You can invest the money saved into other // features if GAE
parts of your business. [7] [Link]
You can move all your data to another environment without engine-its-advantages-and-how-it-can-benefit-your-business/
any difficulty as there is not many dependencies on the app For-more-details-please-refer
engine platform. to [Link]
runtimes.

You might also like