In this tutorial, you created the
Movies table in DynamoDB on your computer and
performed basic operations. The downloadable version of DynamoDB is useful during application development and
testing. However, when you are ready to run your application in a production
environment, you need to modify your code so that it uses the Amazon DynamoDB web service.
Moving to the Amazon DynamoDB Service
You need to change the endpoint in your application in order to use the Amazon DynamoDB service. To do this, modify the following line:
dynamodb = boto3.resource('dynamodb',endpoint_url="https://dynamodb.aws-region.amazonaws.com")
For example, if you want to use the
us-west-2 region, you set the following
dynamodb = boto3.resource('dynamodb',endpoint_url="https://dynamodb.us-west-2.amazonaws.com")
Now, instead of using DynamoDB on your computer, the program uses the DynamoDB service endpoint in US West (Oregon).
Amazon DynamoDB is available in several regions worldwide. For the complete list of regions and endpoints, see Regions and Endpoints in the AWS General Reference. For more information on setting regions and endpoints in your code, go to AWS Region Selection in the AWS SDK for Java Developer Guide.
The downloadable version of DynamoDB is for development and testing purposes only. By comparison, DynamoDB is a managed service with scalability, availability, and durability features that make it ideal for production usage. The following table contains some other key differences between DynamoDB running on your computer and the Amazon DynamoDB service:
|DynamoDB (downloadable version)||Amazon DynamoDB (web service)|
|Creating a Table||The table is created immediately.||Table creation takes some time, depending on its provisioned throughput settings. DynamoDB allocates sufficient resources to meet your specific read and write capacity requirements.|
|Provisioned Throughput||The downloadable version of DynamoDB ignores provisioned throughput settings.||Provisioned throughput is a fundamental concept in DynamoDB. The rate at which you can read and write data depends on your provisioned capacity settings. For more information, see Provisioned Throughput in the Amazon DynamoDB Developer Guide.|
|Reading and Writing Data||Reads and writes are performed as fast as possible, without any network overhead.||Read and write activity is regulated by the provisioned throughput settings on the table. To increase the maximum throughput, you must increase the throughput settings on the table. Network latency also affects throughput to an extent.|
|Deleting a Table||The table is deleted immediately.||Table deletion takes some time, as DynamoDB releases the resources that had been used by the table.|
For more information about Amazon DynamoDB, see the Amazon DynamoDB Developer Guide. We recommend the following topics:
The Amazon DynamoDB Developer Guide also includes the following topics about working with tables, items, and queries: