Home [BoostCamp AI Tech / Final] Day83 - 데이터베이스 변경 및 설계
Post
Cancel

[BoostCamp AI Tech / Final] Day83 - 데이터베이스 변경 및 설계

Final Project : 데이터베이스 변경 및 설계


목차

  • 데이터베이스 변경
  • 데이터베이스 설계

데이터베이스 변경

앞서서 MySQL로 데이터베이스를 선정했으나 너무 비효율적인 문제가 있기 때문에 다시 NoSQL로 데이터베이스를 변경하기로 했습니다. 익숙하게 사용했던 MongoDB를 다시 꺼냈고 GCP를 사용하는 클라우드 데이터베이스인 MongoDB Atlas를 사용했습니다.


데이터베이스 설계

user_info collection

  • 유저의 정보를 저장하는 collection
  • 저장 정보
    • uid : user unique id
    • login : user github id (login id)
    • star_pages : user starpage count
  • Collection 설계
1
2
3
4
5
6
{
	"uid": int,
	"login": string,
	"star_pages": int,
	"star_in_item": list
}

repostiory collection

  • repository 정보 저장 collection
  • 저장 정보
    • rid : repository unique id
    • uid : repository owner user unique id
    • login : repository owner github id
    • repo_name : repository name
    • stars : star count
    • star_pages : star page by 100
    • topics : repository topic tag
    • languages : repository configuration languages
    • category
      • category_L : job type (eg. front-end)
      • category_M : platform or language (eg. React.js)
      • category_S : Criteria classified by awesome
    • updated_at : repository update date
  • Collection 설계
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
	"rid": int,
	"uid": int,
	"login": string,
	"repo_name": string,
	"stars": int,
	"star_pages": int,
	"topics": list,
	"languages": dict,
	"category": {
		"category_L": string,
		"category_M": string,
		"category_S": string
		},
	"updated_at": datetime
}

similarity collection

  • 아이템별 top k 유사도를 저장하는 collection
    • item별 유사도별로 저장
  • 저장 정보
    • rid : repository unique id
    • simn : 특정 유사도 기준 top k개 rid 리스트
  • Collection 설계
1
2
3
4
5
6
{
	"rid": int,
	"sim1": list,
	...
	"simn": list
}

repo_user collection

  • repository와 user의 star linking collection
    $\rightarrow$ repository collection에 star_user_list를 편입하는게 나은가?
  • 저장 정보
    • rid : repository unique id
    • login : repository owner github id
    • repo_name : repository name
    • star_user_list : starred user rid list
  • Collection 설계
1
2
3
4
5
6
{
	"rid": int
	"login": string
	"repo_name": string,
	"star_user_list": list
}

model collection

  • 지속적으로 훈련하는 model의 정보를 저장하는 collection
    • 가장 score가 높은 모델이 최근에 저장됨
  • 저장 정보
    • name : model name
    • model.pt : model.pt information
    • time : save time
    • score : model score metric
  • Collection 설계
1
2
3
4
5
6
{
	"name": string,
	"model.pt": dict,
	"time": datetime,
	"score": float
}
This post is licensed under CC BY 4.0 by the author.

[BoostCamp AI Tech] Day 82 - 두런두런 수근수근 속닥속닥

[BoostCamp AI Tech / Final] Day83 - GCP Redis 환경 세팅

Comments powered by Disqus.