https://github.com/amwebexpert/dynamodb
DynamoDB local POC
https://github.com/amwebexpert/dynamodb
Last synced: 10 months ago
JSON representation
DynamoDB local POC
- Host: GitHub
- URL: https://github.com/amwebexpert/dynamodb
- Owner: amwebexpert
- Created: 2021-01-04T21:00:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-08T00:32:42.000Z (over 5 years ago)
- Last Synced: 2025-04-23T10:55:18.844Z (about 1 year ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DynamoDB POC
## Setup
### Step 1
npm install
### Step 2 Starting local instance of DynamoDB
npm run dynamodb:start
then test it from command line like this:
aws dynamodb list-tables --endpoint-url http://localhost:8000
or open the shell UI:
http://localhost:8000/shell/
Examples Web shell commands:
- type 'list' + control-space this can show/insert code snipets like:
### Step 3 Starting dynamodb-admin GUI
Two good Admin consoles have been tested in this POC:
- https://github.com/YoyaTeam/dynamodb-manager
- https://github.com/aaronshaf/dynamodb-admin
./startDynamoDBManager.sh
then open browser at http://localhost:8002/
### Play with scripts
node src/deleteTable.js
node src/createTable.js
node src/loadData.js
node src/queries-account.js
node src/queries-team.js
node src/queries-user.js
## DynamoDB SDK usage of DocumentClient
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/dynamodb-example-document-client.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.KeyConditionExpressions
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html
## Design considerations
- UUID vs other id
- https://stackoverflow.com/a/44297379/704681 (for case insensitive queries, like nameSearch at insert time or Elastic Search)
- Cost considerations:
- fetching users/accounts by using filtering like `contains` which causes table scanning
- indexes with `ALL` instead of KEYS_ONLY, INCLUDE
- Version for "optimism looking" @DynamoDBVersionAttribute annotation
- Cashing using Spring cache annotations