BUILDING SCALABLE APPLICATIONS WITH GOOGLE CLOUD PLATFORM – SIMPLIFYING TERMINOLOGIES.

Introduction

As computer and internet evolves over the decades, the need for server side applications become imperative and demanding. This demand make developers and programmers around the globe to build application that run on servers and to also serve large number of users. With the rising mobile usage, there is an opportunity for users across different platforms to receive greater satisfactory experience.

To this end, scalability comes in, though scalable applications can require huge resources and rigorous manpower, the idea of infrastructure as a service (IAAS) was birthed to serve as the solution.

Thus, we will briefly look at HOW TO BUILD SCALABLE APPLICATION WITH GOOGLE CLOUD PLATFORM. Before we move further let look into some relevant concepts to this discourse.

WHAT IS A SERVER?

A Server is a computer program or device running in node set, up in a data center, that provides a collection of services to another computer program and its clients.

WHAT IS APPLICATION SERVER?

An application server is software framework that provide platform that facilitates the creation of web application in a configured server environment.

WHAT IS A SERVER SIDE APPLICATION?

Is an application running on a server resident in a data center which is accessible through the internet protocol. The application can be developed using server side scripting language like python, PHP, Java, .Net and others. The application running on server utilizes protocols to access the client destination, the client sends request to server and get response back from the resources.

Native Server side application

The above image is an example of a native server about 50 years back, located in one office with cooling fans beneath, application built during this period are mostly accessed by computer (PCs).
Due to low memory capacity, size of CPU and others factors, the traditional server system was very slow and given unsatisfactory speed and quality of services of client.
As the internet technology evolves and penetration increase, server side applications gained momentum, the old system wasn’t sustainable and developers began to use virtual servers, as shown in the image below

From the image above we have many devices requesting resources from the server. Compared to virtual systems, traffic generated cannot be handled by older system running server side applications. |However, this was also not sustainable when we bring into consideration the concept of scalability and memory to save the huge data generated.
We shall delve into what scalability is, its benefits and what platforms can be used to develop such application, in the current situation with variety of devices ranging from Personal computers to mobile phones of varying qualities.

WHAT IS APPLICATION SCALABILITY?

Scalability is the ability of your application to handle a growing number of customers, clients and/or users.

WHAT ARE THE BENEFITS OF BUILDING SCALABLE APPLICATIONS?

Good user experience
High Potential growth
Easy maintenance
Optimization of resources (alternatively using GCP)

WHAT IS GCP?

Google Cloud Platform been one of the cloud based and infrastructure as a service (IAAS) solution, which provide series of services for your businesses and applications alongside the google data center which is secured, these services include networking, cloud storage, cloud computing and app services.

WHY DO YOU NEED GCP?

Too much request that your server couldn’t handle.
Too much data for server to store.
Low computation capacity.
Little or zero scaling ability.

BENEFITS OF USING GCP

With many product out there, GCP stand out for the following reasons:
It is highly secured.
Low cost advantage.
It allow migration across platforms.
Optimize performance.
Serverless and automatic scaling.

THE APP ENGINE

App engine it is a Platform as a services (PAAS) component of the Google Cloud Platform in the development of your server side application allowing to scale through different users without stress (both front end and backend).
App Engine support the following scripting languages in runtimes for Python 2.7/3.7, Java 8/11, PHP 5/7, Ruby, Go 1.11/1.12+ and Node.js.
App Engine charges for instance usage on an hourly basis. You can track your instance usage on the Google Cloud Console Instances page. Each service that you deploy to App Engine behaves like a microservice that independently scales based on how you configured it.
App Engine allow your application to scale through the use of the cloud endpoints to manage the initialization of instances through leveraging APIs for cross platform usage.

THE CLOUD ENDPOINTS

It is use to generate APIs for all platforms from the app engine. The cloud Endpoints serves as the entry point or gateway and it function make the development of your application easier while you concentrate on frontend, the cloud endpoint handles the backend support through the app engine module to manage your application instances to enable you leverage the scaling ability of the google cloud platform through the app engine.

TYPES OF APPLICATION SCALING

AUTOMATIC SCALING
BASIC SCALING
MANUAL SCALING
AUTOMATIC SCALING
Automatic scaling creates dynamic instances based on request rate, response latencies, and other application metrics. However, if you specify a number of minimum idle instances that specified number of instances run as resident instances while any additional instances are dynamic.

BASIC SCALING

Basic scaling creates dynamic instances when your application receives requests. Each instance will be shut down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.

MANUAL SCALING

Manual scaling uses resident instances that continuously run the specified number of instances regardless of the load level. This allows tasks such as complex initializations and applications that rely on the state of the memory over time.

SCALING UP

When request volumes increases from the clients who users your application, App Engine increase the number of instances to serve the client request.

SCALING DOWN

When request volumes decrease, App Engine reduces the number of instances. This downward scaling helps ensure that all of your application’s current instances are being used to optimal efficiency and cost effectiveness.

DEEP DIVE ON INSTANCES

Instances are the basic building blocks of App Engine, which provide all the resources needed to successfully host your application base on the request of the clients. At any given time, your application can be running on one or more than one instances with requests being spread across all of them. Each instance includes a security layer to ensure that instances cannot inadvertently affect each other.
However, instances are initiated based on your scaling configuration. Your scaling configuration is essential in the leveraging of the app engine resources.

TYPES OF INSTANCE

DYNAMIC INSTANCE.
RESIDENT INSTANCE.
Dynamic instance starts up and shuts down automatically based on current needs from the client requests.
Resident instance runs all the time, which can improve your application’s performance.

INSTANCE STATES

An instance of an auto-scaled service is always running. However, an instance of a manual or basic scaled service can be either running or stopped. All instances of the same service and version share the same state. You change the state of your instances by managing your versions.

INSTANCE SHUTDOWN

The shutdown process can be triggered through range of planned and unplanned events, such as:
Manually stopping the instance.
Version update deployment to the application services.
Complete memory usage.
Your application runs out of Instance Hours quota.
Your instance is moved to a different machine, either because the current machine that is running the instance is restarted, or App Engine moved your instance to improve load distribution.
When App Engine begins to shut down an instance, existing requests are given 30 seconds to complete, and new requests immediately return 404. If an instance is handling a request, App Engine pauses the request and runs the shutdown hook.
You can read more on instance life cycle from the documentation.
That is it, I hope you’ve learn something, if yes share!
For more information - Visit this code labs to learn more

Leave a reply