A web application for testing and comparing data access patterns with DynamoDB and MySQL.
DynamoDB offers fast, predictable latency and unlimited scale via an API interface.
There are many similarities and some important differences between developing on relational database development and DynamoDB. As a developer, you may need to:
- Understand the performance of DynamoDB when evaluating it for use in your application
- Learn DynamoDB's API
- Understand how to port existing SQL commands to DynamoDB
Before migrating to DynamoDB, you can use this web application to compare and contrast the features and performance of each database service.
A query editor and job system will allow you to perform very similar access patterns to each database. With DynamoDB you can use PartiQL, a query language that is similar to SQL.
A job system allows users to create simple scripts that generate sample records. The jobs are stored in the folder /jobs. Each sample record is created by a function called rowMaker that accepts a tick, or iteration number. The job execution function will then loop through and call rowMaker with the loop counter to generate a unique item.
The application runs as a React app using the remix.run framework. This is a popular and robust framework that is an extension of the React Router package. The app has a back-end as well as front end layer. The back end runs on a shell environment and can automatically use the AWS IAM identity that has been setup using the AWS CLI. The web app itself has no login page, and is intended for personal and educational use.
- AWS account
- AWS CLI setup with IAM identity with programmatic access
- Node JS
- An existing MySQL database that is accessible, knowing the hostname, username, password. Create a database called database-app.
You can deploy this to your laptop
- git clone this repository
- cd into the folder
database-app
- run
npm install
- Update the MySQL connection settings in /app/components/mysql-credentials.mjs
- Run
npm run dev
and ensure there are no errors. This runs remix-serve, a mini Express web server - Open a browser and navigate to
http://localhost:3000
- If you are in Cloud9, instead click the Preview button on the top bar (next to the Run button) and then click Preview Running Application. The web app loads in the bottom right corner. You can un-dock this browser into a full-screen experience via the arrow link button on the right side.
There is a top navbar on the page.
- Click to the Setup tab
- Notice the connection details shown in color
- Click the two large buttons to deploy tables to both MySQL and DynamoDB.
- Click to the Query tab
- Run the default query against MySQL and DynamoDB. No records are returned.
- Click to the Jobs tab. This will show a list of job script files from the folder
/jobs
- Click on the job called
load-initial-data
- Click on View Code to see the job code.
- Click on Preview to see a summary of the first five items the job creates.
- Click the run job button MySQL
- Click the run job button DynamoDB
- Return to the Query tab
- Run the default query again on MySQL and DynamoDB, observe results and latencies
You can copy and paste job files to create a new job. Then you can edit the job code to customize the sample items returned. You should see the job appear in the Job list now and can Preview and Run it.
The project roadmap includes:
- An experiment system where the latencies from a job or two similar jobs will be stored as .CSV files in the /experiments folder
- A charting system that will plot the latencies over time, showing statistical summaries of each.