|
| 1 | +# Use cases for iteration of DynamoDB Data Sources |
| 2 | + |
| 3 | +First of all, you must connect your Tinybird Workspace with your Git repository using the [documentation about Versions](https://www.tinybird.co/docs/production/working-with-version-control#connect-your-workspace-to-git-from-the-cli) |
| 4 | + |
| 5 | +### Create a DynamoDB Data Source |
| 6 | + |
| 7 | +- Create the DynamoDB Connection in your main Tinybird Workspace using Tinybird CLI, as explain in the [iteration documentation](https://www.tinybird.co/docs/ingest/dynamodb). Connections reside always in the main Branch. |
| 8 | +- Create a new git branch |
| 9 | +- Create a new DynamoDB .datasource data file in the branch, as in the example PR. You shouldn't need fixtures as the Data Source will be populated from the Connection, but you can add fixtures and/or tests if needed. |
| 10 | + - For information about DynamoDB options read the [connector documentation](https://www.tinybird.co/docs/ingest/dynamodb) |
| 11 | +- Commit your code and create a new PR/MR from the branch to `main` |
| 12 | +- Wait for CI to finish. |
| 13 | +- Check that everything is working as expected in the temporary Tinybird Branch, CI will automatically create it and name it like `tmp_ci_{PRid}`). |
| 14 | +- You can travel to this Branch through UI and check that the Data Source is working |
| 15 | + - You'll need wait for the initial synchronization job to end, check the job status in the dashboard and the logs in the Data Source `log` tab |
| 16 | + - You can add/update/delete items in your DynamoDB table and check that the changes reproduce in the Data Source. |
| 17 | +- If everything is fine, merge and wait for CD. Now you should have your Data Source in the main Workspace, using the Connection, and the temporary CI Branch will be deleted. |
| 18 | + |
| 19 | +[Example Pull Request](https://github.com/tinybirdco/use-case-examples/pull/364) |
| 20 | + |
| 21 | + |
| 22 | +### Update DynamoDB Data Source with a new column, with same Connection |
| 23 | + |
| 24 | +- Create another git branch |
| 25 | +- Add the new column to the schema and query |
| 26 | +- Commit your code and create a new PR from the branch to `main` |
| 27 | +- Wait for CI to finish. |
| 28 | +- Check that everything is working as expected in the temporary branch, CI will automatically create it and name it like `tmp_ci_{PRid}`). |
| 29 | + - You can travel to the Branch through UI and check that the Data Source has the changes applied |
| 30 | + - You can add/update/delete items in your DynamoDB table and check that the changes reproduce in the Data Source. |
| 31 | +- Merge and wait for CD. Now you should have your Data Source updated in the main Workspace, using the Connection, and the temporary CI Branch will be deleted. |
| 32 | + |
| 33 | +[Example Pull Request](https://github.com/tinybirdco/use-case-examples/pull/365) |
| 34 | + |
| 35 | +### Delete a DynamoDB Data Source |
| 36 | + |
| 37 | +- Create another git branch |
| 38 | +- Remove the .datasource data file |
| 39 | + - If the Data Source has dependencies they must be deleted too, to the workflow to work |
| 40 | +- Commit your code and create a new PR from the branch to `main` |
| 41 | +- Wait for CI to finish. |
| 42 | +- Check that everything is working as expected in the temporary Branch, CI will automatically create it and name it like `tmp_ci_{PRid}`). |
| 43 | +- Merge and wait for CD. Now you should have your Data Source deleted in the main Workspace, using the Connection, and the temporary CI Branch will be deleted. |
| 44 | +- If the Connection isn't being used by any other Data Sources, you can remove it directly using CLI. |
| 45 | + |
0 commit comments