Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kafka 적용
생성일, 최종 수정일 필드 추가
생성일
created_at
, 최종 수정일updated_at
필드를 모든 테이블에 추가했습니다. 해당 내용은BaseEntity
에 설정했습니다.상품 엔티티
Product
에서updated_at
의 최댓값은 크롤링 DB에서 가져오는 상품 기준으로 활용됩니다.Kafka
프로젝트에 Kafka를 적용해 DB 간 데이터 동기화를 수행하는데 활용합니다.
서비스에서 직접적으로 사용하는 운영 DB와 크롤링 상품을 담는 크롤링 DB에서 차이가 없도록 2주마다 동기화 처리를 수행합니다.
크롤링 DB에서 가져올 상품들은 ML 서버에서 구현된 API를 통해 가져오게 되며 새 상품은 신규 등록을, 기존 상품은 가격 및 비활성화 여부를 업데이트합니다.
S3 객체 이동
크롤링한 상품이 저장되는 S3 버킷은 서비스에서 활용할 S3 버킷과 다릅니다.
때문에 서비스용 S3 버킷에 크롤링 상품 정보를 옮겨주는 작업이 필요해 S3에 접근할 수 있도록 설정 클래스 추가 후 옮기는 로직을 적용했습니다.
ML 서버 API를 통해 가져오는 상품 정보는 웹 배포된 URI가 아니기 때문에
프론트에서 활용할 수 있도록 웹 배포된 URI로 전처리 후 DB에 저장됩니다.
CLOUDFRONT_URL
는 AWS CloudFront를 통해 웹 배포된 URI를,productDescriptionUrl
는 S3 경로를 의미합니다.productDescriptionUrl
productDescriptionUrl