Friday 5 May 2023

Google App Engine


Google AppEngine

  • Google AppEngine is a PaaS implementation
  • AppEngine is essentially a distributed and scalable runtime environment
  • Developers can develop applications in Java, Python, and Go
  • Go - a new programming language developed by Google to simplify the development of Web applications.


Architecture and core concepts

The platform is logically divided into four major components:

  • infrastructure, 
  • the runtime environment, 
  • the underlying storage, 
  • the set of scalable services

1 Infrastructure

  • AppEngine hosts Web applications, and its primary function is to serve users requests efficiently.
  • The infrastructure is also responsible for monitoring application performance and collecting statistics on which the billing is calculated.

2 Runtime environment 

  • It represents the execution context of applications hosted on AppEngine.
  • Sandboxing 
  • One of the major responsibilities of the runtime environment is to provide the application environment with an isolated and protected context in which it can execute without causing a threat to the server
  • Users can develop AppEngine applications using three different languages and related technologies: Java, Python, and Go.


3 Storage

There are three different levels of storage:

  • in memory-cache,
  • storage for semi-structured data, 
  • long-term storage for static data.

Static file servers 

Web applications are composed of dynamic and static data.

Static data files can be hosted on static file servers, since they are not frequently         modified.

DataStore 

DataStore is a service that allows developers to store semi-structured data.

DataStore provides high-level abstractions that simplify interaction with Bigtable

DataStore also provides facilities for creating indexes on data and to update data

DataStore has been designed to be extremely fast in returning result sets


AppEngine uses an optimistic concurrency control: If one user tries to update an entity that is already being updated, the control returns and the operation fails.


4 Application services

These services simplify most of the common operations that are performed in Web applications: 

  • access to data, 
  • account management, 
  • integration of external resources, 
  • messaging and communication, 
  • image manipulation
  • asynchronous computation.


UrlFetch

capability of retrieving a remote resource through HTTP/HTTPS by means of the UrlFetch service.

MemCache

AppEngine provides caching services by means of MemCache. 

This is a distributed in-memory cache that is optimized for fast access.

Mail and instant messaging 

  • Communication is another important aspect of Web applications.
  • AppEngine provides also another way to communicate with the external world: the Extensible Messaging and Presence Protocol (XMPP). 
  • Any chat service that supports XMPP, such as Google Talk, can send and receive chat messages to and from the Web application,

Account management

    AppEngine simplifies account management by means of Google Accounts.

The use of Google Accounts requires users to have a Google account,

The use of Google Accounts is particularly advantageous for developing Web applications within a corporate environment using Google Apps.

Image manipulation 

Web applications render pages with graphics.

AppEngine allows applications to perform image resizing, rotation, mirroring, and enhancement by means of Image Manipulation


5 Compute services

  • Users navigate the Web pages and get instantaneous feedback in response to their actions.
  • This feedback is often the result of some computation happening on the Web application.
  • AppEngine offers additional services such as Task Queues and Cron Jobs.

Task queues 

Task Queues allow applications to submit a task for a later execution. This service is particularly useful for long computations that cannot be completed within the maximum response time of a request handler. 

Cron jobs

Sometimes a required operation needs to be performed at a specific time of the day,

It is possible to schedule the required operation at the desired time by using the Cron Jobs service.






Application life cycle

The life cycle of an application: 

testing and development, 

deployment,

monitoring

The SDKs released by Google provide developers with most of the functionalities required by these tasks. 

Currently there are two SDKs available for development: Java SDK and Python SDK.

1 Application development and testing

  • Developers can start building their Web applications on a local development server.
  • The development server simulates the AppEngine runtime environment
  • The development server contains a complete set of monitoring features that are helpful to profile the behavior of applications.
  • The development server analyzes application behavior while running and traces all the queries made during testing and development.

Java SDK

Using the Eclipse software installer, it is possible to download and install Java SDK, Google Web Toolkit, and Google AppEngine plug-ins into Eclipse. 

These three components allow developers to program powerful and rich Java applications for AppEngine

Developers can easily create Web applications by using the Eclipse Web Platform, which provides a set of tools and components. 

The plug-in allows developing, testing, and deploying applications on AppEngine.

Python SDK 

The Python SDK allows developing Web applications for AppEngine with Python 2.5.

It provides a standalone tool, called GoogleAppEngineLauncher

The Python implementation of the SDK also comes with an integrated Web application framework called webapp.

Webapp includes a set of models, components, and tools that simplify the development of Web applications.

Another Web framework that is known to work well is Django.


2 Application deployment and management

  • Once the application has been developed and tested, it can be deployed on AppEngine with a simple click or command-line tool.
  • Developers use an app identifier to upload and update applications.
  • Once an application identifier has been created, it is possible to deploy an application on AppEngine.
  • Once the application is uploaded, nothing else needs to be done to make it available. 
  • AppEngine will take care of everything. Developers can then manage the application by using the administrative console. 

3 Cost model 

AppEngine provides a free service with limited quotas that get reset every 24 hours. 

Once the application has been tested and tuned for AppEngine, it is possible to set up a billing account and obtain more allowance and be charged on a pay-per-use basis.

An application is measured against billable quotas, fixed quotas, and per-minute quotas.

Google AppEngine uses these quotas to ensure that users do not spend more than the allocated budget