Skip to content

Nutri-AI/Database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Design NutriAI Database

Using the AWS SDK for Python Boto3 to create, configure, and manage AWS services, Amazon DynamoDB.

  • 아마존의 NoSQL 데이터베이스 서비스
  • 완전 관리형의 서버리스 데이터베이스
  • 키-값 쿼리 형식

ERD

NutriAI_database_ERD

Design the primary key

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

Prerequisites

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.

Start with Dockerfile

Build image

docker build . -t <name>:<tag>

Run image

docker run --rm -ti -v $(pwd):/dynamo <name>:<tag> bash

Implementation

Create a table

python code/nutriai_dynamo_create_table.py 

Put items

python code/nutriai_dynamo_put_item.py 

Delete a table

python code/nutriai_dynamo_delete_table.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published