Cloud deployment architecture for Web applications

Cloud computing is the on-demand delivery of computing resources/services over the internet. These services include computing power, storage, data stores (databases), analytics, streaming & eventing services and many more. In Amazon Web Services(AWS), there are over 200 different cloud services that customers can use to fulfill their business needs. Google cloud platform also offers over 150 services to their customers. Other cloud platforms also offer many services to their customers.

Cloud computing is becoming very much popular nowadays due to it's ease of use, flexibility, security and upfront cost benefits. Previously, we need to invest huge sums of money to setup and maintain physical data centers and servers to run applications. The investment amount depends on the scale of the applications.  So, even before taking the product to the market, we need to spend a large amount of money in the infrastructure. Another issue is with scaling. We cannot scale resources up and down on the basis of traffic since we need to predict the traffic upfront and setup the infrastructure as accordingly. Another major challenge in maintaining own physical data centers and servers is the domain knowledge. These cloud service providers are experts in the server infrastructure, and maintaining that level of knowledge with in-house team members is a real challenge and costly project as well.

With cloud computing, we can setup basic servers within minutes and even build a complex server architectures within days. Also, we can scale the cloud resources as per the customer traffic very easily. When our purpose is served and we no longer need to use those resources, we can destroy the entire infrastructures within minutes/hours depending on the way server setup is done. We only pay for the resources that we have used and only for the time the resources were used.

Following are the types of cloud computing:

  • Infrastructure as a Service (IaaS)

    In IaaS, the cloud provider manages all the IT infrastructures and provides access to those resources using high level APIs to the customers. Customers then use those IT infrastructures to build their own software architecture and deploy applications along with all the other necessary dependencies.

  • Platform as a Service (PaaS)

    In PaaS, the cloud provider manages everything from infrastructure to all the software packages including the operating system needed to run the customer's application. The role of customers in PaaS model is to develop, run and manage their own applications.

  • Software as a Service (SaaS)

    In SaaS, the cloud provider hosts the software products and manages everything from infrastructure to regular maintenance of the software application. They offer the subscription based packages to the customers.

We will implement the following basic server architecture for our application over the course of this tutorial series.

Cloud Deployment architecture for web applications

This architecture diagram is created with the help of diagrams.net (formerly draw.io), which is a free online diagram software.

From the server architecture diagram above, we intend to use four server instances  to fully implement our application in the cloud during the entirety of this series. Following are the server instances:

  1. Web server

    • This is the server with static public IP address attached to it and can be accessed from the internet. All the client requests to the application will go through this server
    • Software Component: NGINX web server
    • Ports 80 and 443 will be exposed to the internet
    • Port 22 for ssh access will be accessible to the internet, only through VPN connection to our vpn server.
  2. Application server

    • This is the private server instance which is accessible only from the web server.
    • Software Component: Docker with Node.js
    • Ports 3000 will be exposed to the web server instance only
    • Port 22 for ssh access will be accessible to the internet, only through VPN connection to our vpn server.
  3. Data Store(Database) server

    • This is the private server instance which is accessible only from the application server.
    • Software Component: MySQL and Redis
    • Ports 3306 and 6379 will be exposed to the application server instance only
    • Port 22 for ssh access will be accessible to the internet, only through VPN connection to our vpn server.
  4. VPN server

    • This is the server with static IP address attached to it and can be accessed from the internet. This will be used to initiate the VPN connection.
    • Software Component: OpenVPN server
    • Initially Port 22 for ssh access will be accessible to the internet.
    • Ports 1194 or 443 will be exposed to the internet
    • Once VPN server is up and running, Port 22 for ssh access will be accessible to the internet, only through VPN connection to our vpn server.

There are many cloud providers which we can use to deploy our application. Some of the most popular ones are:

In our next chapter, we will discuss about setting up a cloud server using AWS Lightsail service.

Prev Chapter                                                                                          Next Chapter