Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Google App Engine

You're reading from   Mastering Google App Engine Build robust and highly scalable web applications with Google App Engine

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784396671
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

The structure of an application

When you are developing a web application that has to be hosted on Google App Engine, it has to have a certain structure so that the platform can deploy it. A minimal App Engine application is composed of an application manifest file called app.yaml and at least one script / code file that handles and responds to requests. The app.yaml file defines the application ID, version of the application, required runtime environment and libraries, static resources, if any, and the set of URLs along with their mappings to the actual code files that are responsible for their processing.

So eventually, if you look at the minimum application structure, it will comprise only the following two files:

  • app.yaml
  • main.py

Here, app.yaml describes the application and set of URLs to the actual code files mappings. We will examine app.yaml in greater detail in a later section. The app.yaml is not the only file that makes up your application. There are a few other optional configuration files as well. In case you are using datastore, there may be another file called index.yaml, which lists the kind of indexes that your app will require. Although you can edit this file, it is automatically generated for you, as your application runs queries locally.

You then might have a crons.yaml file as well, that describes various repeated tasks. The queus.yaml file descries your queue configurations so that you can queue in long running tasks for later processing. The dos.yaml is the file that your application might define to prevent DoS attacks.

However, most importantly, your application can have one or more logical modules, where each module will run on a separate instance and might have different scaling characteristics. So, you can have a module defined by api.yaml that handles your API calls, and its scaling type is set to automatic so that it responds to requests according to the number of consumers. Another named backend.yaml handles various long running tasks, and its scaling type is set to manual with 5 instances on standby, which will keep running all the time to handle whatever the long running tasks handled to them.

We will take a look at modules later in this book when discussing deployment options in Chapter 10, Application Deployment.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime