The note when designing applications on the AWS platform

Tram Ho

Preamble

When building a new system or converting an existing system to the AWS platform, we need to choose the right model, meet customer requirements, easily expand in the future, besides the system. The system needs to have high availability and fault tolerance (errors can come from an end user, some component of the system).

Issues to note

1. Error tolerance

Let’s take a look at a simple web application below, which only includes a web instance connected to the RDS database

It is easy to recognize system failures if the web server is either RDS or Availability zone fail, this is the same as putting all the eggs in one basket. To overcome the disadvantages of this architecture, we will add the redundancy component. There are 2 types of redundancy:

  • Standby redundancy : Often used for relational database components. When a resource fails, the process is restored to secondary resources through failover.
  • Active redundancy : Execution requests will be distributed on different resources (for example, running the same application on multiple web instances) when one instance fails, requests will be allocated to the other. to execute.

The original model will be converted as follows:

2. Flexibility

Besides meeting fault tolerance, flexibility is also a factor to consider when designing a system. Flexibility is shown by the system can accommodate the number of users, traffic, data size increases over time, or dramatically increase due to business needs without sacrificing performance. . In other words, the architecture must be easy to expand. There are two types of extensions

  • Scale vertically : Increasing specifications such as increasing hard drive capacity, increasing RAM. The advantage of this method is easy to use, flexible application in many cases. However, the increase in configuration will have to stop at a certain limit, and the cost is also relatively high
  • Scale horizontally : Expressed by increasing the amount of resources (adding storage hard drives, adding instances). This is also the right approach for systems using cloud computing platforms.

The web application model uses horizonetally scaling:

3. Choose a hosting solution

AWS offers a variety of storage services to satisfy diverse data storage needs such as EBS, S3, RDS, CloudFront. Depending on the needs, functions, performance and cost, we choose the right product. Eg

  • AWS S3 : Use for storage, data backup or large storage capacity
  • AWS Glacier : Long-term archive + backups that can be considered for use
  • CloudFront : When you need dynamic / static content distribution networks or global streaming for quick access
  • DynamoDB : When a NoSQL database is needed, with a flexible, high-performance data model
  • AWS RDS : Gives you mysql database with high availability, easy scalability and good security
  • ElasticCache : Provides Redis cluster for the application
  • Elastic File System (EFS) File system shared for one or more EC2 instances Try optimizing the original model, using AWS storage services. Store image, videos, CSS and Javascript files to S3 and then distribute the data using CloudFront. This way we will reduce the load on the web instance as well as speed up the loading of content through the CDN.

Or the combined model using ElasticCache and DynamoDB

When analyzing system design, we need to identify the data storage needs so that the service and the model can be selected accordingly.

4. Multi-layer security

AWS provides many features that allow the design of a deep security system. Starting at the network level, using the Amazone Vitual Private Cloud (VPC) to help launch resources in a virtual network, we have full control over these networks including IP range, subnet creation, router configuration. route, connection port. To the application level, AWS provides WAF firewall system with settings to prevent common attack patterns, bad bots, SQL injection. By accessing, we can use IAM to identify, manage, and delegate rights to one or a group of users or resources on AWS.

Conclude

Any application that runs after a period of use will pose certain risks. A system is highly available when it still functions normally when one or several components of the system go down.

With traditional hosting, it is necessary to predict the amount of resources that the application needs to use over a period of several years. If the initial low rating leads to the system does not meet the actual user flow, leading to customer dissatisfaction. If the estimate is too high, it will cause waste of system resources as well as increase costs.

With cloud computing services allow us to be more flexible in meeting the actual needs, flexible scale, optimal use of resources. Provides multi-layer security capabilities, allowing administrators to track configuration changes to system resources

References:

Share the news now

Source : Viblo