Analyze your DynamoDB usage on the AWS cloud, and see the pricing for an equivalent usage of ScyllaDB’s Alternator, which is a drop-in alternative for DynamoDB.
For the sake of simplicity the usage of both on-demand and provisioned tables is expressed in read or write capacity units. In the case of provisioned tables, it corresponds to the provisioned capacity. In the case of on-demand tables, by default it corresponds to the average usage per second over the last 30 days, and it can be configured (see the from-date
and to-date
options). Providing a custom time range is useful in case the usage pattern of the tables over the last 30 days is not representative of a typical workload.
The application is available as an AWS Serverless Application, or a Node.js command-line application.
The AWS Serverless Application can be installed in a few clicks and makes it easy to share your results within your organization.
The command-line interface requires Node.js and aws
to be installed on your machine, and can be more convenient to use for scripting purpose.
The simplest way to use the application is to deploy the version published to the AWS Serverless Application Repository. Alternatively, you can build the application from the sources and deploy it with the AWS SAM CLI.
dynamodb:ListTables
, dynamodb:DescribeTable
, and cloudwatch:GetMetricData
. The application will not read, change, delete, or share any of your data.To delete the application, delete the CloudFormation stack that was created during the deployment step. Open the CloudFormation console at https://console.aws.amazon.com/cloudformation#/stacks. Find the deployed stack (for example, look for serverlessrepo-dynamodb-pricing-comparison
), and choose “Delete”.
You need the following tools:
npm
package management tool.Start by cloning this repository:
git clone https://github.com/scylladb/dynamodb-pricing-comparison.git
cd dynamodb-pricing-comparison
To build and deploy the application for the first time, run the following in your shell:
sam build
sam deploy --guided
The first command will build the source of the application. The second command will package and deploy the application to AWS, with a series of prompts:
CAPABILITY_IAM
value for capabilities
must be provided. If permission isn't provided through this prompt, to deploy this example you must explicitly pass --capabilities CAPABILITY_IAM
to the sam deploy
command.sam deploy
without parameters to deploy changes to the application.The following output will be displayed in the outputs when the deployment is complete:
Open that endpoint URL to collect metrics about your DynamoDB usage and visualize the results on a web page. See the “Use” section below for more options.
To delete the application, you can use the AWS CLI. Assuming you used dynamodb-pricing-comparison
for the stack name, you can run the following:
sam delete --stack-name dynamodb-pricing-comparison
The installation process outputs the URL of an API endpoint that you can call to collect metrics about your DynamoDB usage.
You can pass options as query parameters. See below the supported options. For instance, to export your DynamoDB usage into a CSV file, use the following command:
curl "${API_GATEWAY_ENDPOINT_URL}?format=csv" > dynamodb-usage.csv
Where API_GATEWAY_ENDPOINT_URL
is the URL of the API endpoint produced by the installation process.
You need the following tools:
Start by cloning this repository:
git clone https://github.com/scylladb/dynamodb-pricing-comparison.git
cd dynamodb-pricing-comparison
Install the application dependencies:
npm install --prefix ./backend
Make sure that your AWS credentials are up-to-date in ~/.aws
, or run aws configure
to configure the region and account to collect the DynamoDB usage from.
Run the command-line interface:
bin/dynamodb-pricing-comparison.mjs > dynamodb-usage.html
Then open the file dynamodb-usage.html
in a web browser.
Pass the --help
argument to show the usage documentation:
bin/dynamodb-pricing-comparison.mjs --help
You can pass options as command-line arguments. See below the list of supported options. Prefix each option name with --
. For instance, to export your DynamoDB usage into a CSV file, use the following command:
bin/dynamodb-pricing-comparison.mjs --format=csv > dynamodb-usage.csv
format
: Accepted values are either html
or csv
. This parameter is optional and defaults to html
. With html
, the endpoint produces an HTML page that can be rendered by a Web browser. With csv
, the endpoint produces a CSV document with the following columns:
PAY_PER_REQUEST
, or PROVISIONED
)from-date
: Start date to use when collecting usage of on-demand tables. By default, the start date is 30 days ago. It must be supplied if to-date
is supplied. Valid format: ISO 8601 dates such as YYYY-MM-DD
or YYYY-MM-DDThh:mm
, e.g. 2024-08-05
or 2024-08-05T08:00
.
to-date
: End date to use when collecting usage of on-demand tables. By default, the end date is the date of today. Valid format: ISO 8601 dates such as YYYY-MM-DD
or YYYY-MM-DDThh:mm
, e.g. 2024-08-05
or 2024-08-05T08:00
.
See the CONTRIBUTING.md file to learn how to build, maintain, and publish the application.
The content of this repository is released under the Apache 2.0 License.