The author, who has no programming experience, has summarized the minimum knowledge required to bring a Rails application to AWS.
The summarized contents are as follows. ・ AWS ・ VPC ・ EC2 ・ RDS
Reference: What is the Availability Zone
First of all, about the AWS network. The first thing to mention when using AWS is the ** Region ** and ** Availability Zone (AZ) **.
** Region ** refers to the location (country and region) where AWS provides services. If you use a distant region, network delay may occur, so basically use the Tokyo region.
** Availability Zone (AZ) ** Data Center (Provides a place to install and accommodate IT equipment such as server machines However, it is almost the same as a facility that provides various services for stable operation. AZs are prepared for each region, and four AZs are prepared in the Tokyo region.
AWS recommends using multiple AZs (multi-AZ configuration). With a multi-AZ configuration, if one AZ fails, you can avoid network failures by using another AZ.
Next, I will explain about AWS services.
VPC(Virtual Private Cloud)
See: VPC and Subnets
VPC is a service that creates a network. Create a VPC network inside the AWS network as shown above. And VPCs can be split by creating subnets.
Roughly speaking It's an image of a large box (AWS) with a reasonably large box (VPC) and a small box (subnet) inside.
Then, EC2 and RDS, which will be explained below, will be placed in this small box (subnet).
EC2(Elastic Compute Cloud)
Reference: How to start an instance
EC2 is a service that can use ** virtual server (instance) **, ** firewall (security group) **, etc.
A word you don't know came out ...
I will explain it roughly.
The instance corresponds to the server of the conventional on-premises environment.
The instance has information such as OS, CPU, and memory.
In other words, "creating an instance" means ** "Select the conditions such as OS, CPU, memory, etc. and create the server you want" **.
Security groups are a standard AWS firewall feature. You can grant access to your EC2 instances and control traffic.
** By default, all communication is blocked. (important)** Therefore, it is necessary to allow specific communication.
Access permissions are divided according to the direction of communication, and are divided into ** inbound ** and ** outbound **. ** Inbound **: Allow communication from outside to instance (outside → instance) ** Outbound **: Allow communication from instance to outside (instance → outside)
I think this security group is the most error-prone part for beginners when dealing with AWS.
Make sure you understand that security groups are essential for linking multiple services.
RDS(Relational Datebase Service)
Reference: Scenario for accessing a DB instance in VPC (official)
RDS is a service that allows you to use Relational Database (RDBMS) on the cloud.
There are two ways to use an RDBMS on AWS. (important)
** 1. How to install an RDBMS on an EC2 instance ** ** 2. How to use RDS **
In RDS, an instance (virtual server) for the database is created, and the OS and database engine are built on it. Therefore, the user does not need to maintain the server or middleware.
Basically, using RDS can reduce the cost of construction and operation, so when operating RDBMS, RDS is often selected.
It's pretty rough, but I've summarized my knowledge about AWS.
If you actually touch AWS while referring to the following articles, you will deepen your understanding of the details.
・ The most polite AWS commentary in the world. Until you bring your Rails app to AWS using EC2
Recommended Posts