The demand in business applications is growing fast and developers are facing many challenges such as evolutivity, scalability, and re-usability. In order to satisfy business needs, developers around the world need to create new tools that will help them solve the above presented challenges.
With the development of cloud infrastructure, some of these challenges, particularly scalability and evolutivity, can be easily solved. It is now possible to do anything in the cloud, even coding with function-as-a-service (FaaS) products like Function Compute. But, to solve the re-usability problem, the solution must come from the code used for the application we are developing. This is where the Django framework comes in handy, in the way it is a useful tool to develop reusable web app and in a short time.
The purpose of this tutorial is to show you how you can build your an application right from the cloud, by using a web framework tailored to address current challenges web developers face. I hope this tutorial will help you to understand how you can build your own development environment on the cloud and benefit from the ubiquity of that solution.
Why Django?
Before we discuss about Django, let's take a step back to better understand what a web application is. A web application is a set of code written in a programming language that will be rendered on a browser, which typically addresses a well-defined problem. For example, it can be a blog post (like this article!), an e-commerce website, or even a social network.
Okay, that's pretty straightforward, but what is a web framework? Web frameworks are reusable collections of components that handle many of the common and repetitive tasks of web-application development in an integrated fashion. Instead of requiring you to obtain disparate libraries of code and find ways to make them work together, web frameworks provide all the necessary components in a single package and take care of the integration work for you.
Great. Now that we're familiar with the concepts of web apps and frameworks, let's talk about Django. Django is one of the most recent web frameworks that is aimed at simplifying web app creation. Django gives you a set of tools that will help you quickly develop highly dynamic web applications that are re-usable, scalable and clean.
Django is built upon the DRY (Don't Repeat Yourself) paradigm, which means that in every step of the development process, you will have to write less code that the average needed using another framework.
In these series of tutorials, I'll guide you through the development of several applications and show you how the various components and applications bundled with Django can help you write less code at each stage of the development process, and how you can do all these things in the cloud. We will be running our web application on an Alibaba Cloud Elastic Compute Service (ECS) instance. I will not be covering the steps for setting up Django on your ECS. Instead you can refer to these two tutorials to learn more:
The project we are going to build is an e-commerce web application where people can buy or sell items. For flexibility and maintainability reasons, the project will be split in three independent apps: the Core app, the Cart app and the Payment.
Alibaba Cloud Enterprise Distributed Application Service (EDAS) is providing PaaS platform for hosting applications and micro services with high availability, monitoring and release management capabilities. To extend the EDAS capabilities, we can build continuous integration/deployment solution using EDAS and Jenkins.
In this tutorial, I'll demonstrate how a sample website can be hosted in EDAS platform and can be website upgraded automatically as soon as the new version of code is committed into GitHub.
For this article, we'll be using a web application written in Java and war build of this application is deployed in EDAS. Also, source code of this application is maintained in GitHub repository.
Any changes of the GitHub repository will be pushed to Jenkins and build of Jenkins pipeline project will be automatically triggered to generate new war file with latest version of the source code and to deploy the war file using EDAS API into same EDAS application.
Please decide a single region (Preferably China- Beijing) for configuring all the required Alibaba cloud services before you proceed. This will help you to avoid any technical challenges of integrating multi region services.
High Availability (HA), Fault Tolerance (FT), and Horizontal Scale Friendly (HSF) are as equally important as to functionality for web applications to run and succeed today. Existing or new web applications shall be designed and provisioned with such architecture underlying. Fortunately, you can easily and promptly deploy mentioned architecture in the Cloud era today (compared to the on-premises bare-metal machine era)! However, this flexibility comes with a caveat – how to choose the right cloud provider? We are spoiled with choice when it comes to choosing cloud providers and it can be really challenging (and hectic!) when evaluating and choosing the right one.
This post is intended to discuss and provide a walkthrough on deploying web applications on Alibaba Cloud from the ground up, including HA, FT, and HSF. There is no intention to discuss on requirement analysis and capacity planning on particular specific domain (I’m a newbie to Alibaba Cloud). Anyway, throughout this post, I will briefly introduce several services & tools provided in Alibaba Cloud. Yes, briefly! If you wish to learn more on particular services or tools, please visit the Documentation Center. In addition, the post would also highlight the concerns and considerations when deploying such services.
WordPress is used as the demo web application that would be deployed on Alibaba Cloud in this post. The same deploying principle shall apply to many other web applications. This post is not intended to discuss on WordPress configuration at all. It shall not (and not able to) serves as reference for WordPress configuration. There are tons and tons of good resources out there regarding best practices on WordPress administrative.
Like many other web applications, the demo web application consists of application layer (WordPress) and DB layer (MySQL).
In order to achieve such “simple” goal, the demo web application must deployed with the following ‘minimum’ requirements:
Fortunately, Alibaba Cloud provides a list of services and tool for us to fulfill such ‘minimum’ requirements. In this post specifically, we would utilize Cloud DNS (DNS), Auto Scaling Group (ASG), Server Load Balancer (SLB), Elastic Compute Service (ECS), Relational Database System (RDS), Object Storage Service (OSS), and Object Storage File System (OSSFS) tool to achieve mentioned Goal. The high-level architecture diagram for the deployed WordPress would be as following:
Simple Application Server is a new generation computing service for stand-alone application scenarios.
Deploy ECS instances with just a few clicks from the easy-to-use console and scale capacity up or down based on real-time demands.
Want to learn how to construct a dynamic website that can actively update its content? In this Clouder lesson, you will learn how to build a WordPress website on Alibaba Cloud. The language of instruction in the video course is Cantonese. All presentation materials and exam questions are in English.
Want to learn how to construct a dynamic website that can actively update its content? In this Clouder lesson, you will learn how to build a WordPress website on Alibaba Cloud.
Web Hosting is equipped with built-in OS, databases, FTP sites and other services, which enable you to readily build a website. This article helps you familiar with the preparations and process on building a website.
Before you start building a website with Web Hosting, you need to consider and prepare the following:
A domain name represents the server of a website on the Internet. With a domain name, one can search and visit your website. Therefore, before you start building and publishing your website, you need to register a domain name.
Prepare the source code and data of your website and compress them into a package.
After you install WordPress in a Web Hosting instance, you have resolved CNAME to the test domain of the Web Hosting instance. After you bind the formal domain name, you can use the formal domain name to access the website. However, logon verification is required when you log on to the background.
A test domain name is entered during the installation of WordPress, so WordPress calls the address suffixed with *.aliwebs.com
and jumps to the test domain name. The test domain name of the Web Hosting instance is used for debugging the website. Therefore, verification is required when you log on to the background.
Understand application security and common network attacks. You will master the core skills of application security on the cloud, including how to access Alibaba Cloud WAF, avoid tampering website, prevent CC attacks, and how to conduct business risk management.
Classical web application environment with LAMP stack and the next generation of PHP version 7. It also includes Selfmanagement Preset, a self-management, self-monitoring and self-healing components and phpMyAdmin, a web interface tool for the administration of MySQL.
6 Best Practices for Deploying an Application on Alibaba Cloud (Part 2)
Cloud Application Architecture: Hosting & Things to Remember
2,599 posts | 762 followers
FollowAlibaba Clouder - August 14, 2018
Alibaba Clouder - July 24, 2018
Alibaba Clouder - August 25, 2020
Alibaba Clouder - October 20, 2020
Alibaba Clouder - August 25, 2020
Alibaba Clouder - August 15, 2019
2,599 posts | 762 followers
FollowRespond to sudden traffic spikes and minimize response time with Server Load Balancer
Learn MoreExplore how our Web Hosting solutions help small and medium sized companies power their websites and online businesses.
Learn MoreMore Posts by Alibaba Clouder