By Shantanu Kaushik
Developing and deploying applications to the cloud is a process that requires accordance with certain practices that guarantee a fast, reliable and scalable application architecture. In the previous article of this series we discussed two main pointers to follow while developing applications and deploying them using Alibaba Cloud.
This article is a continuation of Part 1 of the same topic; we strongly recommend you to read it first here.
Following a little recap, we already discussed that making a choice between IAAS, PAAS and SAAS is one of the most important decisions to take depending on your use case scenario. With that choosing an IDE is also an important decision. The platform that you build your application on defines and sets out a path for your application development phase.
We also discussed how you should develop an application like a collection of services or APIs that can be used for further development with code reusability.
In this article we are going to discuss optimizing communication between your components, decoupling of data, modelling your applications to attain maximum performance and scalability and integrating security measures within your application design.
As a standard I am using Alibaba Cloud products and solutions for the scenarios and representations as it is my default cloud provider. We will be referencing Alibaba Cloud Elastic Compute Service (ECS) with Simple Application Server among other products and services.
As we already know that a cloud architecture is based on distributed computing, hence developing and deploying applications for cloud should check most checkboxes in terms of compatibility with distributed resources.
When you deploy your application based on your choice of platform, you need to make sure that you do not deploy your application with tightly coupled data. Tight coupling of data makes it harder for the distributed system to process.
Platforms like Alibaba Cloud Simple Application Server break out the processing and data into separate tasks to provide a faster and more reliable user experience. With that an application maybe deployed in multiple zones for better availability, in this case decoupled application data will be considered a far better course of action. It is more or less like you build application as a collection of APIs or services for better usability and maintenance.
Let us look at how it would look in an Alibaba Cloud environment:
In a common practice, you may want to store your data on local servers to allow virtual machine instances to interact and work with the public cloud. Once your data is decoupled, you can easily achieve this.
Apsara DB RDS for MySQL works better and follows the same pattern when storing to the database or backing up the databases.
The cache layer stores and delivers most common and highly called data instances, without having to call for the data source again and again. Continuous database queries can slow down the response time and delivery. If your data is loosely coupled, your database can leverage it better. Make sure to build a cache strategy right into your application and run tests with application data during production stages.
Understanding and estimating your application behaviour out of production environment can be achieved by rigorous testing and phase planning. Knowing how your application will scale under increasing load and managing it is among the very first consideration you must have while developing your application.
Much information can be extracted if different components of your application communicate with each other and record data to create a better performing architecture. The first step has to be an application model that understands shortcoming, manages resources and scales the application for maximum performance and availability.
As a developer, you have to use test cases to ensure that with increasing load your application is able to maintain stability by calling in proper backend resources at the correct time. Although, Alibaba Cloud ECS is highly reliable and when paired with Server Load Balancer (SLB) and Cloud Monitor, it takes care of backend resources usage along with storage (OSS) and database handling.
Let's take an example. Assuming your traffic load is at 5000 user access in a continuous range. With a sudden spike in traffic 4000 more users are now accessing your application, your application now has to scale over 90% to accommodate the traffic. In this instance your back-end resources will be called to action. More server instances and more database instances will have to be provisioned to maintain application stability.
Auto scaling also comes in at this point of time and communicates with SLB and ECS to provide a stable resource with increasing load. However, your application has to be designed in a way that it can scale itself and the resources according to increasing or decreasing load.
You need to understand and record data at this point of time. This data will help you understand the behaviour of your application in such conditions and will help you make design changes to develop a better performing application. Once your design model is in place, you can rely for stability on it. Scaling your resources based on actual data of how your application behaves in different setting is the most important bit in application development.
You have put together a model for your application development and have considered design phase with data decoupled and optimized for traffic load. Now its time to consider having optimized communication between different modules of your application. Too much communication and too less of it, both of these are not recommended.
It is highly recommended to make one single managed channel of communication rather than multiple channels for different operational commands and requests.
Security measures are often thought of while deployment of an application and mostly considered and left to vendor. I am not saying that we as developers don't build security measures right into the application, but on various occasions it is left as an afterthought. Your application architecture should have security built right into it.
Having said that, the first thing to do here is to pick up your approach to this. You need to select the technology before you start building your application and look at existing security issues associated to it. Taking an example here, applications like the Vehicle registration and Road Tax department of India. These kind of applications need to follow a certain level of privacy while the data is sent to the user. Though privacy laws are not so strict in our country, the application developer has to be one step ahead and think of these scenarios before deployment.
Alibaba Cloud Resource and Access Management (RAM) is one such product that takes care of such scenarios. Cloud based applications should always leverage access and identity management. This not only enables a better secured application architecture; it provides for better migration scenarios and helps new application development architectures to form and age.
Always remember one core objective associated with building applications. That is to test the application and know its requirements before you go and deploy it. Make sure that it capable of taking advantage of products and services in place by the Cloud provider, in this case Alibaba Cloud.
All these approaches should be a priority for better modelled applications. Most developers come across bugs and issues after development, but the application is based on a well thought out model and has gone through a thorough design process with considerations like security, scalability and management, there is little to worry about.
I want to let you leave here with one basic thought that every programmer has followed like a rule of thumb for decades. That is always code, correct and deploy. It's a traditional practice, but is always a great advice to follow.
Alibaba Clouder - August 26, 2020
Alibaba Clouder - June 2, 2020
- March 8, 2018
Alibaba Clouder - September 16, 2019
Alibaba Clouder - March 6, 2019
Alibaba Developer - March 3, 2020
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
Apsara Stack Agility Elastic Compute Service (Alibaba Cloud ZStack) is a light-weight hybrid cloud solution.Learn More
High Performance Computing (HPC) and AI technology helps scientific research institutions to perform viral gene sequencing, conduct new drug research and development, and shorten the research and development cycle.Learn More
An all-in-one solution for deploying applications, building websites and blogs, and running web programs, starting from $3.50/month.Learn More
More Posts by Alibaba Clouder