|
| 1 | +# Demo Script |
| 2 | + |
| 3 | +## Before Demo Setup |
| 4 | + |
| 5 | +* Verify MySQL is set up and running locally |
| 6 | +* Verify Q CLI is set up and logged in with Pro subscription |
| 7 | +* Verify MySQL instance is populated with data |
| 8 | +* Verify Docker set up |
| 9 | + |
| 10 | +To install MCP server, add to MCP JSON: |
| 11 | + |
| 12 | +```json |
| 13 | +{ |
| 14 | + "mcpServers": { |
| 15 | + "ddb-migrate": { |
| 16 | + "command": "uv", |
| 17 | + "args": [ |
| 18 | + "run", |
| 19 | + "--with", |
| 20 | + "mcp[cli]", |
| 21 | + "--with", |
| 22 | + "mysql-connector-python", |
| 23 | + "mcp", |
| 24 | + "run", |
| 25 | + "/tmp/modernizer-workspace/AWS-GenAI-DB-modernizer/dynamodb/ddb-migrate/server.py" |
| 26 | + ], |
| 27 | + "env": {}, |
| 28 | + "timeout": 120000 |
| 29 | + } |
| 30 | + } |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +```shell |
| 35 | +$ mkdir /tmp/modernizer-workspace |
| 36 | +$ cd !$ |
| 37 | +$ git clone ssh://git.amazon.com/pkg/AWS-GenAI-DB-modernizer |
| 38 | +$ git clone -b mysql-with-tests ssh://git.amazon.com/pkg/DynamoDBOnlineShopApp |
| 39 | +``` |
| 40 | + |
| 41 | +Follow the README in ddb-migrate to build the MCP server. To install it, add to Q's mcp.json: |
| 42 | + |
| 43 | +```json |
| 44 | +{ |
| 45 | + "mcpServers": { |
| 46 | + "ddb-migrate": { |
| 47 | + "command": "uv", |
| 48 | + "args": [ |
| 49 | + "run", |
| 50 | + "--with", |
| 51 | + "mcp[cli]", |
| 52 | + "--with", |
| 53 | + "mysql-connector-python", |
| 54 | + "mcp", |
| 55 | + "run", |
| 56 | + "/tmp/modernizer-workspace/AWS-GenAI-DB-modernizer/dynamodb/ddb-migrate/server.py" |
| 57 | + ], |
| 58 | + "env": {}, |
| 59 | + "timeout": 120000 |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +Now load Q: |
| 66 | + |
| 67 | +```shell |
| 68 | +$ q |
| 69 | +> /tools |
| 70 | +[...] |
| 71 | +ddb_migrate (MCP): |
| 72 | +- ddb_migrate___analyze_logs * not trusted |
| 73 | +- ddb_migrate___connect_database * not trusted |
| 74 | +- ddb_migrate___extract_schema * not trusted |
| 75 | +``` |
| 76 | + |
| 77 | +Make sure to stop any test data generation against the source database. |
| 78 | + |
| 79 | +## Intro |
| 80 | + |
| 81 | +* Where we start |
| 82 | +* Where we end |
| 83 | + |
| 84 | +## Analyze source MySQL database and design data model |
| 85 | + |
| 86 | +```shell |
| 87 | +> Using the ddb-migrate MCP server tools, follow the prompt AWS-GenAI-DB-modernizer/dynamodb/prompts/01_mysql_migration_modeler_prompt.md |
| 88 | +``` |
| 89 | + |
| 90 | +* Ask to run the benchmark first when prompted |
| 91 | +* Show choices presented and how to compare |
| 92 | +* Identify preferred option |
| 93 | + |
| 94 | +## Make application code changes |
| 95 | + |
| 96 | +```shell |
| 97 | +> Run through AWS-GenAI-DB-modernizer/dynamodb/prompts/02_dal_indirection.script.md using DynamoDBOnlineShopApp as the codebase path |
| 98 | +> Run through AWS-GenAI-DB-modernizer/dynamodb/prompts/03_generate_dal_code.script.md using DynamoDBOnlineShopApp as the codebase path, and the file Stage3_DataModel.md as the data model description |
| 99 | +> Run through AWS-GenAI-DB-modernizer/dynamodb/prompts/04_generate_feature_flag.md using DynamoDBOnlineShopApp as the codebase path, and the file Stage3_DataModel.md as the data model description |
| 100 | +``` |
| 101 | + |
| 102 | +* Show starting state |
| 103 | +* Add indirection layer |
| 104 | +* Add DynamoDB implementation (with dual-write logic) |
| 105 | + |
| 106 | +## Create tables in AWS, test out ported app against DDB without any data migrated |
| 107 | + |
| 108 | +```shell |
| 109 | +> Run through the AWS-GenAI-DB-modernizer/dynamodb/prompts/05_table_deployment.md prompt to deploy a CFN stack with the tables from the desired data model |
| 110 | +``` |
| 111 | + |
| 112 | +* Create empty tables following the data model |
| 113 | +* Run app against DynamoDB only |
| 114 | +* Show user registration flow, empty product list |
| 115 | +* Live debug HTML issues if needed |
| 116 | +* Show tables populated with data from our activity |
| 117 | +* Delete and recreate tables to prepare for migration |
| 118 | + |
| 119 | +## Show Dual Write |
| 120 | + |
| 121 | +* Enable feature flag for dual write |
| 122 | +* Run through product checkout flow to show data from source database is used |
| 123 | +* Show tables populated with new data from order |
| 124 | + |
| 125 | +## Backfill data from source database |
| 126 | + |
| 127 | +```shell |
| 128 | +> Run through the AWS-GenAI-DB-modernizer/dynamodb/prompts/06_etl_deployment.md prompt to deploy a CFN stack with the tables from the desired data model |
| 129 | +> Run the Python script AWS-GenAI-DB-modernizer/dynamodb/tools/generate_mysql_views.py to generate database views in MySQL using the contract JSON file in the current directory |
| 130 | +``` |
| 131 | + |
| 132 | +* TODO: Either write script to connect to DB and run, or have the user login and run the commands. Owner: Andy |
| 133 | +* Run script to create views in source DB |
| 134 | +* Run script to backfill data |
| 135 | +* Explain approach, emphasize conditional writes |
| 136 | +* Show data landed in target tables |
| 137 | + |
| 138 | +## Show Dual Read |
| 139 | + |
| 140 | +* Now we can compare reads between the source database and target |
| 141 | +* Enable feature flag for dual read |
| 142 | +* Run through same product checkout flow, show logs indicating reads are equivalent |
| 143 | + |
| 144 | +## Talk through cutover process |
| 145 | + |
| 146 | +* Talk through cutting over reads, validating behavior, and then cutting over writes |
| 147 | +* After cutting over writes, the source database will be missing some writes, making rollback more difficult |
| 148 | + |
| 149 | +## Conclusion |
0 commit comments