Configuring the Amazon Relational Database Service (RDS)

As we have the A1ElectronicsEcommerce EC2 instance is up on the cloud, we now need to create a RDS instance within our VPC for our A1ElectronicsEcommerce web application. 

  1. From the RDS dashboard click on Launch a DB Instance instance. This will start a process of provisioning a RDS instance:
  1. The next step is to select the SQL database engine. For our application, we will select MySQL. Click on the Next button:
  1. The next step is to decide if the RDS DB instance will be used for production environment or outside of it. Under production environment RDS provides option for high availability RDS instance. It also provides an option of provisioning IOPS for your RDS DB instance as per your application’s need. All this sounds good but the costs can add up, quickly. As we are in a development mode currently, we will ignore the production choices for now. We select the Dev/Test - MySQL option, and click on Next:
  1. The next step is to configure the RDS instance.
    1. License model: Since we are using the MySQL Community Edition, general-public-license is the only option available.
    2. DB engine version: This option allows you to select a specific version of MySQL. Choose the latest unless you have MySQL specific code that runs for a specific version:
    1. DB instance class: This is the same as choosing the EC2 instance type. This will select the virtual server, which will run your MySQL database engine, faster DB instances can be chosen as per your database workload after profiling them, db.t2.micro is the only one which is available for the free tier so we select it.
    2. Multi-AZ deployment: This option is for high availability as discussed earlier. Select No from the dropdown list.
    3. Storage type: Select General Purpose (SSD). The other option is Provisioned IOPS which kicks in only if your allocated storage is 100 GB or more, and Magnetic which is slower.
    4. Allocated storage: You use the minimum, which is 20 GB. The free tier allows storage up to 20 GB:
    1. DB instance identifier: This is the identifier for the MySQL server database instance, and this identifier is used to define the DNS entry for the DB instance. Type a1ecommerce in the text field.
    2. Master username: Master login name to access the DB instance, it needs to start with an alphabet. Enter a1dbroot for the master username.
    3. Master password: Password for the master username.
    4. Confirm password: Type in the master password again.
    5. Click on the Next button:
  1. Next, we configure some advanced settings:
    1. Virtual Private Cloud (VPC): This is the VPC network where the DB instance will reside. It is the same default VPC network in which our EC2 instance resides. Since there is only one VPC defined, select the Default VPC from the drop down.
    2. Subnet group: This allows for the selection of a DB subnet. A DB subnet is a logical subdivision of the VPC network space. This is useful in large implementations where you might have a use case for different DB instances being logically separated from each other. Here the DB instance is in same subnet as the EC2 instance. This can be achieved by selecting the correct availability zone. Select default from the dropdown.
    3. Public accessibility: It is a good security practice to hide your databases from the internet. But then access to the DB instance is only possible after remotely logging into the EC2 instances running within the same VPC or by setting up SSH tunnels. During the development phase, this becomes very inconvenient and frustrating to manage database schema changes, viewing data, and debugging. So by keeping things simple select the Yes option. For production DB instances, this should be set to No and a VPC security group that allows access from within the VPC should be created and assigned.
    4. Availability zone: Select No preference from the drop-down box. It assigns the appropriate subnet to the DB instance:
  1. VPC security groups: Select sq-RDSSecurityGroup and sq-EC2WebSecurityGroup from the list (these security groups were created earlier):
  1. In the next set of fields, we specify the Database options.
    1. Database name: The name of the database to which an application connects to. Name it a1ecommerceDb
    2. Database port: The default MySQL port. Do not change the default port number, which is set to 3306.
    3. DB parameter group: Management of DB engine configuration is done via the parameter group. This allows you to change the default DB configuration. Since we have not created any parameter group, select the default default.mysql5.6.

 

    1. Option group: An option group allows to set additional features provided by the DB engine to manage the data and the database and to provide additional security to your database. Since we have not created any option group, select the default default.mysql.5.6:
  1. We disable Encryption option as shown here as we do not want to encrypt the data stored in the database: 
  1. Next, we specify the backup parameters for our database.
    1. Backup retention period: The number of days Amazon RDS keeps the automatic backup for the instance. The range is between in 1 and 35 days. This helps enable one-click restoration of the data in case of disaster recovery. Selection of 0 days disables backup retention. Select 0 from the drop down.  
    2. Backup window: The time slot during which the automatic backups take place. The selected time period should be such during which the database load is least. It is normally set when we deploy the database in production. During development cycle this can be set to No Preference:
  1. We select Disable enhanced monitoring for our development database:
  1. Next, we specify the Maintenance options.
    1. Auto minor version upgrade: Amazon RDS will automatically update the DB instance only for minor updates. Select the Enable auto minor version upgrade option.
    2. Maintenance window: Any modifications to the DB instance like changing the DB instance class, storage size, password, multi availability zone deployment. These changes take place during the maintenance window period. Again this is useful for production instances. The maintenance window can be overridden during the time of modification of the DB instance. Select the No preference option:
  1. Click on the Launch DB instance button. This will create a DB instance and launch it:
  1. From the RDS dashboard, click on Instances in the navigation pane and then on a1ecommerce to view the details of the DB instance. If you note there is no IP address associated with the DB instance, the only way you can access this DB instance is via the endpoint:
  1. Here, we display the Connect settings section of the details screen as we will be using some of them in the subsequent steps for installing and verifying the software stack:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.89.123