‫Okay, so just a short lecture
‫on two DynamoDB Operations you may get to sit on.
‫So the first one is around how to do a table cleanup.
‫So to do so, you have two options.
‫First, you can scan all the items in your table
‫and then delete them one by one,
‫which is very, very slow
‫and can consume a lot of RCU on the scan operation
‫and WCU on the delete operation,
‫so it's expensive.
‫The option two is much more quick,
‫which is to drop the table.
‫So drop it, remove it, and then recreate this table.
‫So it's fast, efficient and cheap.
‫And you just need to make sure you recreate this table
‫with the correct settings just like the one before.
‫Now, if you wanted to copy DynamoDB Table
‫across accounts, regions, places,
‫there's two options.
‫The first one is to use AWS Data Pipeline.
‫And this is probably only time in the exam
‫you will see Data Pipelines,
‫so I'm not spending some time on it.
‫I just want to show you what it does.
‫So in this case, we want to copy DynamoDB Table
‫into another one.
‫So Data Pipeline in the backend
‫is going to launch an Amazon EMR Cluster.
‫EMR will be reading from the DynamoDB Table
‫using a scan operation and writing it back
‫into Amazon S3 to store it.
‫Then, on the second step,
‫it will read back the data from Amazon S3
‫and then insert it back into a new DynamoDB Table, okay?
‫So this is Data Pipeline
‫and this thing will be synchronizing
‫and coordinating all these operations in the backend.
‫Option two, which I like a lot more,
‫is to do a backup of your DynamoDB Table
‫and restore it into a new table,
‫which takes some time,
‫but it's more efficient and doesn't require
‫any external other services.
‫And number three is a little bit more tricky.
‫You do a scan on your own,
‫and then you do a put item or batch rate items
‫if you want to be more efficient.
‫You have to write your own code,
‫but you can do some transformations in the meantime.
‫This is not the recommended way,
‫but another option you would consider anyway, okay.
‫So that's it for this lecture.
‫I hope you liked it and I will see you in the next lecture.