Skip to content

Commit

Permalink
corrected wording errors and style (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBette authored Jun 27, 2024
1 parent 0e43f7e commit a5117a4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 43 deletions.
29 changes: 15 additions & 14 deletions content/hands-on-labs/backups/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ backup,
[on-demand](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BackupRestore.html)
and [point-in-time
recovery](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PointInTimeRecovery.html)
(PITR). PITR is on a rolling window, on-demand backups stay around
(PITR). PITR uses a rolling window, while on-demand backups stay around
forever (even after the table is deleted) until someone tells DynamoDB
to delete the backups. When you enable PITR, DynamoDB backs up your
table data automatically with per-second granularity. The retention
period is a fixed 35 days (5 calendar weeks) and can't be modified.
However, large enterprise customers who are used to deploying tradition
Large enterprise customers who are used to deploying traditional
backup solutions in their data centers often want a centralized backup
solution that can schedule backups through “jobs” and handle tasks such
as expiring/deleting older backups time, monitoring the status of
on-going backups, verifying compliance, and finding / restoring backups,
as expiring/deleting older backups, monitoring the status of
ongoing backups, verifying compliance, and finding / restoring backups,
all using a central console. At the same time they don't want to
manually manage their backups, create their own tools via scripts or
[AWS Lambda](https://aws.amazon.com/lambda/) functions, or use a
Expand All @@ -29,24 +29,25 @@ the ability to have a standardized way to manage their backups at scale
to the resources in their AWS account.

[AWS Backup](https://aws.amazon.com/backup/) aims to be the single point
of centralize backup management and source of truth that customers can
rely on. You can schedule periodic or future backups by using AWS
Backup, The backup plans include schedules and retention policies for
of centralized backup management and source of truth that customers can
rely on. You can schedule periodic or future backups in AWS
Backup. The backup plans include schedules and retention policies for
your resources. AWS Backup creates the backups and deletes prior backups
based on your retention schedule. Backups of resources are always
required in case of disaster recovery.

AWS Backup removes the undifferentiated heavy lifting of manually making
and deleting On-demand backups by automating the schedule and deletion
for you. In this lab we will be exploring how to schedule periodic
backups of a DynamoDB table using AWS Backup. I am going to create a
backup plan where I take daily backup and keep it for a month. Next I
setup a backup rule to transition the backup to cold storage after 31
days and auto-delete the backup after 366 days from backup creation
backups of a DynamoDB table using AWS Backup. We will create a
backup plan where we take daily backup and keep it for a month. Next, we
set up a backup rule to transition the backup to cold storage after 31
days and auto-delete the backup after 366 days from the backup creation
date.

Also, I show you how you can restrict people in your organization to
delete the backups from AWS backup and DynamoDB console while able to do
others operations like create backup, create table etc.
Also, we will learn how to restrict people in your organization from
deleting the backups from AWS backup and DynamoDB console while still
allowing them to perform other operations like create backup, create
table, etc.

Now lets dive into the different DynamoDB backup options.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Item Collections are groups of Items that share a Partition Key. By definition,
When we invoke the *Query* API we must specify a [Key Condition Expression](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.KeyConditionExpressions). If we were comparing this to SQL, we would say "this is the part of the WHERE clause that acts on the Partition Key and Sort Key attributes". This could take a couple of forms:

* Just the Partition Key value of our Item Collection. This indicates that we want to read ALL the items in the item collection.
* The Partition Key value and some kind of Explore the other options in the Item explorer and figure out how to get queries to return with Replies sorted from most recent to least recent.
, >=, BETWEEN, and BEGINS_WITH.
* The Partition Key value and some kind of comparison against the Sort Key, such as >=, BETWEEN, or BEGINS_WITH.

The Key Condition Expression will define the number of RRUs or RCUs that are consumed by our Query. DynamoDB will add up the size of all the rows matched by the Key Condition Expression, then divide that total size by 4KB to calculate the consumed capacity (and then it will divide that number in half if you're using an eventually consistent read).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Click `JSON view`, ensure `View DynamoDB JSON` is deselected, paste the followin

The DynamoDB [UpdateItem API](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html) is used to create a new item or to replace existing items completely with a new item. It is invoked using the [update-item CLI command](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/update-item.html). This API requires you to specify the full Primary Key and can selectively modify specific attributes without changing others(you don't need to pass in the full item).

The DynamoDB [DeleteItem API](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html) is used to create a new item or to replace existing items completely with a new item. It is invoked using the [delete-item CLI command](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/delete-item.html).
The DynamoDB [DeleteItem API](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html) is used to delete a single item from the table. It is invoked using the [delete-item CLI command](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/delete-item.html).

You can easily modify or delete an item using the console by selecting the checkbox next to the item of interest, clicking the **Actions** dropdown and performing the desired action.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The CloudFormation template used below will create Source VPC, EC2 hosting MySQL
7. Click "Submit"
8. The CloudFormation stack will take about 5 minutes to build the environment
![Final Deployment Architecture](/static/images/migration7.jpg)
9. Go to [EC2 Dashboard](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:) and ensure the Status check column is 2/2 checks passed before moving to the next step.
9. Go to [EC2 Dashboard](https://console.aws.amazon.com/ec2/v2/home?region=us-west-2#Instances:) and ensure the Status check column is 2/2 checks passed before moving to the next step.
![Final Deployment Architecture](/static/images/migration8.jpg)


Expand Down
51 changes: 26 additions & 25 deletions content/hands-on-labs/rdbms-migration/migration-chapter03.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,63 @@ menuTitle: "Explore Source Model"
date: 2021-04-25T07:33:04-05:00
weight: 30
---
IMDb [(Internet Movie Database)](https://www.imdb.com/interfaces/) is one of the most recognized names for its comprehensive online database collection of movies, films, TV series and so on.
The exercise is going to use subset of IMDb dataset (available in TSV format). This workshop will utilize 6 IMDb dataset that are related to US based movies since year 2000.
The dataset has around 106K+ movies, ratings, votes and cast/crew information.
IMDb [(Internet Movie Database)](https://www.imdb.com/interfaces/) is Amazon's comprehensive online database of movies, films, and TV series.
The workshop uses 6 IMDb datasets related to movies made in the United States since the year 2000.
The dataset has over 106K movies, ratings, votes, and cast/crew information.

The CloudFormation template has launched EC2 Amazon Linux 2 instance with MySQL installed and running.
It has created imdb database, 6 new tables (one for each IMDb dataset), downloaded IMDb TSV files to MySQL server local directory and uploaded the files to 6 new tables. To explore dataset, follow below instructions to login EC2 server.
It has also configured a remote MySQL user based on the CloudFormation input parameter.
The CloudFormation template launched an EC2 Amazon Linux 2 instance with MySQL installed and running.
It created a MySQL database called `imdb`, added 6 new tables (one for each IMDb dataset), downloaded the IMDb TSV files to MySQL server local directory, and loaded the file contents into the 6 tables.
The CloudFormation template also configured a remote MySQL user based on input parameters for the template.
To explore the dataset, follow the instructions below to log in to the EC2 server.

1. Go to [EC2 console](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:instanceState=running)
2. Select the MySQL-Instance and click Connect
1. Go to [EC2 console](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:instanceState=running).
2. Select the MySQL Instance and click Connect.
![Final Deployment Architecture](/static/images/migration9.jpg)
3. Make sure ec2-user is filled under the User name field. Click Connect
3. Make sure "ec2-user" is in the Username field. Click Connect.
![Final Deployment Architecture](/static/images/migration10.jpg)
4. Elevate your privilege using sudo command
4. Elevate your privileges using the `sudo` command.
```bash
sudo su
```
![Final Deployment Architecture](/static/images/migration11.jpg)
5. Go to the file directory
5. Go to the file directory.
```bash
cd /var/lib/mysql-files/
ls -lrt
```
6. You can see all the 6 files copied from the IMDB dataset to the local EC2 directory
6. You can see all the 6 files copied from the IMDB dataset to the local EC2 directory.
![Final Deployment Architecture](/static/images/migration12.jpg)
7. Feel free to explore the files.
8. Go to AWS CloudFormation [Stacks](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks?filteringStatus=active&filteringText=&viewNested=true&hideStacks=false) and click on the stack you created earlier. Go to the Parameters tab and copy the user name and password mentioned next to DbMasterUsername & DbMasterPassword
8. Go to AWS CloudFormation [Stacks](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks?filteringStatus=active&filteringText=&viewNested=true&hideStacks=false) and click on the stack you created earlier. Go to the Parameters tab and copy the username and password listed next to "DbMasterUsername" and "DbMasterPassword".
![Final Deployment Architecture](/static/images/migration13.jpg)
9. Go back to EC2 Instance console and login to mysql
9. Go back to EC2 Instance console and login to mysql.
```bash
mysql -u DbMasterUsername -pDbMasterPassword
```
![Final Deployment Architecture](/static/images/migration14.jpg)
10. Congratulations! You are now connected to a self-managed MySQL source database on EC2. In next steps, we will explore database and tables hosting IMDb datasets
10. Congratulations! You are now connected to a self-managed MySQL source database on EC2. In the following steps, we will explore the database and tables hosting IMDb datasets.
```bash
use imdb;
```
![Final Deployment Architecture](/static/images/migration15.jpg)
11. Show all the tables created;
11. List all the tables created by the CloudFormation stack.
```bash
show tables;
```
![Final Deployment Architecture](/static/images/migration16.jpg)

For illustration purpose, below is a logical diagram represents relationship between various source tables hosting IMDb dataset.
For illustration purposes, below is a logical diagram represents relationship between various source tables hosting IMDb dataset.

- `title_basics` table has movies published in US after year 2000. `tconst` is an alphanumeric key uniquely assigned to each movie.
- `title_akas` has published regions, languages and respective movie titles. It's 1\:many relationship with `title_basics` table.
- `title_ratings` has movies rating and vote count. For this exercise, we can assume the information has high frequency update post movie release. It's 1:1 related with `title_basics` table
- `title_principals` has cast and crew information. It's 1\:many relationship with `title_basics` table.
- `title_crew` has writer and director information. The table is 1:1 related with `title_basics` table.
- `title_basics` has movies published in the US after the year 2000. `tconst` is an unique alphanumeric key assigned to each movie.
- `title_akas` has published regions, languages, and the respective movie titles. It has a 1\:many relationship with the `title_basics` table.
- `title_ratings` has movies rating and vote count. For this exercise, we can assume the information has high frequency updates post movie release. It has a 1:1 relationship with the `title_basics` table.
- `title_principals` has cast and crew information. It has a 1\:many relationship with the `title_basics` table.
- `title_crew` has writer and director information. It has a 1:1 relationship with the `title_basics` table.
- `name_basics` has cast and crew details. Every member has unique `nconst` value assigned.
![Final Deployment Architecture](/static/images/migration31.jpg)

12. We will create denormalized view with 1:1 static information and get it ready for migration to Amazon DynamoDB table. For now, go ahead and copy below code and paste into the MySQL command line.
The details around target data model will be discussed in the next chapter.
12. We will create a denormalized view with 1:1 static information and get it ready for migration to Amazon DynamoDB table. For now, go ahead and copy the code below and paste into the MySQL command line.
We will discuss the details around the target data model in the next chapter.
```bash
CREATE VIEW imdb.movies AS\
SELECT tp.tconst,\
Expand Down Expand Up @@ -87,7 +88,7 @@ CREATE VIEW imdb.movies AS\
LEFT JOIN imdb.name_basics nm ON tp.nconst = nm.nconst\
LEFT JOIN imdb.title_crew tc ON tc.tconst = tp.tconst;
```
Use below command to review count of records from the denormalized view. At this point, your source database is ready to migrate to Amazon DynamoDB.
Use this command to check the count of records from the denormalized view. At this point, your source database is ready to migrate to Amazon DynamoDB.
```bash
select count(*) from imdb.movies;
```

0 comments on commit a5117a4

Please sign in to comment.