0% found this document useful (0 votes)
3 views14 pages

Create MySQL and DynamoDB on AWS

The document outlines the steps for creating a MySQL database instance on AWS RDS and connecting it to an EC2 Linux server. It also details the process for creating a DynamoDB table and inserting data into it. The instructions include specific configurations and commands to execute for successful database setup and data management.

Uploaded by

psaran709
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views14 pages

Create MySQL and DynamoDB on AWS

The document outlines the steps for creating a MySQL database instance on AWS RDS and connecting it to an EC2 Linux server. It also details the process for creating a DynamoDB table and inserting data into it. The instructions include specific configurations and commands to execute for successful database setup and data management.

Uploaded by

psaran709
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment 1

 Creation of Database (Relational and No-SQL)

1. Create MySQL DB Instance and Connect MySQL DB instance.

Synopsis:
Create a RDS and an EC2 Linux Server Instance. Connect the EC2 Instance to the RDS
created. Create a Database and Table. Insert few records into the Table then read the
records inserted and verify.
2. How to create Dynamo DB table and Write Data in table.
Steps to create RDMS:
1. Search RDS in Search bar. Then Click on Create Database.
2. Select MYSQL Version Default and select Free tier.
3. Give Database name ExcelR-DB user name as admin and give
to password.

4. Select Don’t select EC2 instance. VPC Default. Select Public


access Yes.
5. Click on create DataBase.

6. Below image we can see the MYSQL Database.


7. Launch New EC2 Linux Ubuntu instance.

8. Below image we can see the Linux server EC2 instance.


9. Connect Linex server and install MYSQL-server.

10. Service start Mysql. And below image we can see the
status of Mysql.
11. Connect MYsql Database which we launch in AWS by
using End point ID.
12. Below image we can see the the MYSQL was connected.

13. Create a sample data base excelrbd by executing Query


Create database excelrbd;
14. Create a table Persons in excelrdb database.
15. Insert values into the Table.
16. Below image we can see the Table with values.
Steps to Create DynamoDB:
1. Search DynamoDB in Services. Click on Create Table.

2. The New page will appears.


3. Give Table name as Population.
4. PartionKey As Country with String.

5. Click on Create Table.


6. Click on Population Table.

7. This new page will appears.


8. In Action Click on Create Items.

9. Give the Infor,mation that should be stored in table. I have


Given some information which is shown in below image. Then
Click on Create items.
10. In below image we can see the table information.

11. In items referred in Action tab Download results to CSV.


By clicking this we can download the CSV file. Of table
information

Common questions

Powered by AI

One can verify the records inserted into a MySQL table on an EC2 instance by connecting to the MYSQL database using the endpoint ID, executing a 'SELECT' query to retrieve the records, and ensuring they match the data inserted. Verification is crucial to confirm data integrity and ensure the correctness of database operations, which is vital for application reliability .

The partition key in DynamoDB is a vital component because it determines how data is distributed across shards. It affects data retrieval in that the hash value of the partition key directs where the item is stored, impacting query performance. A well-chosen partition key can evenly distribute data, allowing for efficient reads and writes. Poor partition key design can result in 'hot partitions', which can degrade performance due to uneven data distribution .

Not verifying the endpoint ID when connecting an EC2 instance to a MySQL RDS instance can lead to failed connection attempts, as the endpoint ID is critical for directing the EC2 instance to the correct database. Unauthorized access risks are increased if mistyped endpoint IDs inadvertently connect to unintended databases. Such issues disrupt the reliability of application connections and highlight the importance of accurate configuration for ensuring secure and stable interactions between services .

Choosing public access in AWS RDS makes the database accessible over the internet, which can be beneficial for applications requiring worldwide access but raises security risks due to exposure to potential attacks. Private access, on the other hand, restricts access to within the AWS network (e.g., EC2 instances within a VPC), enhancing security by reducing the surface area exposed to external threats, though it limits accessibility to within the network .

One might choose to use the AWS Free Tier options to reduce costs, particularly for testing and development environments. The Free Tier provides limited resources, meaning it might not support high-volume production workloads effectively. The primary trade-off is that while it minimizes initial costs, performance and capacity are restricted, which could hinder scalability and response times as demands increase .

To connect a MySQL instance to an EC2 instance in AWS, one must first create a RDS for MySQL by searching RDS in the AWS console, clicking on 'Create Database', selecting the MySQL version, choosing the Free tier, and setting a database name along with admin credentials. Public access should be set to 'Yes'. Secondly, an EC2 Linux Ubuntu instance must be launched. The MySQL server is installed on this Linux server, started, and connected to the MySQL RDS using the endpoint ID. This step is crucial because it allows the EC2 instance to interact with the database, enabling the development and testing of applications in a cloud-based environment .

Setting up a DynamoDB table involves searching for DynamoDB in AWS services, creating a table with a specified table name and partition key, and then inserting data directly into it. Unlike MySQL’s step-by-step detailed instance creation and manual configuration, DynamoDB simplifies the process, allowing for automatic scaling based on demand without manual intervention. The implications for scalability are significant; DynamoDB can handle large amounts of data and traffic seamlessly, whereas MySQL requires manual scaling and configuration, which could limit performance as data grows .

Downloading table information as a CSV from DynamoDB allows easy integration with data analysis tools, enables straightforward sharing of data across different platforms, and facilitates backup and archiving processes. It is particularly useful for generating reports and performing offline analyses, thus enhancing data portability and accessibility .

Starting the MySQL service on an EC2 instance is critical because it enables the database server to run and accept connections. Without the MySQL service running, any attempt to establish connections with the database would fail, preventing data storage and retrieval operations. This step ensures that the MySQL instance is operational and ready for database management tasks .

Creating a database in MySQL involves selecting a MySQL version, configuring network settings, and manually setting up database parameters, followed by creating tables and inserting data through SQL queries. Setting up a table in DynamoDB is more streamlined; it requires specifying a table name and a partition key, with automatic scaling and easy data insertion through a web interface. The MySQL process is more complex and offers more configuration flexibility, whereas DynamoDB provides simplicity and scalability with less manual configuration .

You might also like