Book Image

Mastering Google App Engine

Book Image

Mastering Google App Engine

Overview of this book

Table of Contents (18 chapters)
Mastering Google App Engine
About the Author
About the Reviewers


Google App Engine is a Platform as a Service that builds and runs applications on Google's infrastructure. App Engine applications are easy to build, maintain, and scale.

Google App Engine allows you to develop highly scalable web applications or backends for mobile applications without worrying about the system administration's plumbing or hardware provisioning issues. You can just focus on writing your business logic, which is the meat of the application, and let Google's powerful infrastructure scale it to thousands of requests per second and millions of users without any effort on your part.

This book introduces you to cloud computing, managed Platform as a Service, the things that Google has to offer, and the advantages. It also introduces you to a sample app that will be built during the course of the book. It will be a small invoice management application where we have clients, products, categories, invoices, and payments as a sample SaaS application. The most complex part is that of reporting, as datastore has certain limitations on this.

What this book covers

Chapter 1, Understanding the Runtime Environment, explains the runtime environment, how requests are processed and handled, and how App Engine scales. This chapter also explores the limitations of runtime environments with respect to the request time and response size, among other factors.

Chapter 2, Handling Web Requests, introduces ways to handle web requests by using a built-in framework or Django and others. It also discusses how to serve static files and caching issues, render templates.

Chapter 3, Understanding the Datastore, covers the problem of storing huge amounts of data and processing it in bulk with the ability to randomly access it. This chapter explains the datastore in detail, which is built on top of Bigtable.

Chapter 4, Modeling Your Data, explains the new ndb Python library on top of Google datastore. It will also teach you how to model your data using its API.

Chapter 5, Queries, Indexes, and Transactions, focuses on how to query your data, the limitations, and ways to work around these limitations.

Chapter 6, Integrating Search, builds upon the datastore and shows how to make data searchable.

Chapter 7, Using Task Queues, introduces the reader to task queues, which enable the background repeated execution of tasks.

Chapter 8, Reaching out, Sending E-mails, talks about how the app can send and receive e-mails and how to handle bounce notifications.

Chapter 9, Working with the Google App Engine Services, introduces you to the other services that are provided by Google App Engine to make you aware of your available options.

Chapter 10, Application Deployment, talks in detail about deploying the GAE apps.

What you need for this book

In order to run the code demonstrated in this book, you need an interpreter that comes with the Python 2.7.x series and the latest Google App Engine SDK release of the 1.9.x series.

Additionally, to access the example application, once it runs on App Engine, you need a recent version of a web browser such as Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Internet Explorer.

Who this book is for

If you have been developing web applications in Python or any other dynamic language but have always been wondering how to write highly scalable web applications without getting into system administration and other areas that plumbing, this is the book for you. We will assume that you have no experience of writing scalable applications. We will help you build your skill set to a point where you can fully leverage the environment and services of Google App Engine, especially the highly distributed NoSQL datastore, to neatly knit and jot down a very robust and scalable solution for your users, be it a web application or a backend for your next killer mobile app.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: " We can include other contexts through the use of the include directive."

A block of code is set as follows:

class Person(ndb.Model):
    name = ndb.StringProperty()
    age = ndb.IntegerProperty()

Any command-line input or output is written as follows:

$ appcfg update /path/to/my/app/containing/app.yaml/

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: " Now, double-click on the Launcher icon that you just dragged to the Applications folder ".


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.