Using the AWS SDK for Python Boto3 to create, configure, and manage AWS services, Amazon DynamoDB.
- 아마존의 NoSQL 데이터베이스 서비스
- 완전 관리형의 서버리스 데이터베이스
- 키-값 쿼리 형식
Entity | HASH | RANGE |
---|---|---|
사용자 | USER#USERID | USER#USERID#INFO |
영양상태로그 | DATE#NUTRSTATUS#MEAL or SUPPLTAKE | |
식단로그 | DATE#MEAL#TIME | |
영양제섭취로그 | DATE#SUPPLTAKE#TIME | |
권장섭취량 | RDI#age_range | RDI#sex |
식품 | FOOD#food_cat | FOOD#food_name |
영양제 | NUTRSUPPL#nutr_cat | NUTRSUPPL#product_code |
Edit code/aws_def_values.py.example file
# code/aws_def_values.py
## for AWS Access
aws_access = {
'region_ap': '', # AWS region
'aws_access_key_id': '', # AWS Access key ID
'aws_secret_access_key': '' # AWS Secret access key
}
# DynamoDB
table_nutriai = "" # table name
Make data/ directory and put the data files into the data/ directory for DB.
Build image
docker build . -t <name>:<tag>
Run image
docker run --rm -ti -v $(pwd):/dynamo <name>:<tag> bash
python code/nutriai_dynamo_create_table.py
python code/nutriai_dynamo_put_item.py
python code/nutriai_dynamo_delete_table.py