분류 전체보기
-
index - mysqlDB 2023. 8. 13. 17:18
INDEX란? RDBMS에서 인덱스(INDEX)는 데이터베이스의 특정 테이블의 한 또는 여러 열에 대한 자료 구조로, 레코드(ROW)를 빠르게 찾는데 도움을 준다. 인덱스는 대형 데이터베이스에서 데이터 검색 속도를 크게 향상시킬 수 있다. INDEX를 생성하는 방법 1. 이미 테이블이 존재한다면? - 데이터의 중복을 허용하는 컬럼의 인덱스를 거는 경우. CREATE INDEX [index의 별칭] ON [table명] ([column명]) 예> create index member_name_idx name on member (name); - 데이터의 중복을 허용하지 않은 컬럼(들)의 인덱스를 거는 경우. CREATE UNIQUE INDEX [index의 별칭] ON [table 명] ([column명], ..
-
N + 1 문제Spring/JPA 2023. 8. 6. 16:55
JPA는 테이블 간의 연관관계를 Mapping 해주는 ORM기술의 하나이다. JPA는 Java의 객체지향적 관점과 DB의 테이블 참조관계 사이의 불일치하는 부분을 해소하면서 원하는 데이터를 가지고 올 수 있게 해준다. Spring data jpa를 사용하면서 맞닥드릴 수 있는 N + 1 문제에 대해서 설명하고 해결 방법을 알아보자. Spring Data JPA JPA는 성능 최적화를 위해 지연로딩이라는 기술을 활용한다. 지연로딩이란, 관련이 있는 엔티티를 필요한 시점에 로딩하는 것을 말한다. 예를 들어 Member entity와 Team entity가 있다고 가정해보자. Team 에는 여러명의 Member가 소속될 수 있다면, Member와 Team Entity는 N : 1 관계가 된다. 기본적으로 @M..
-
CICD (GitHubActions + EC2 + RDS + S3 + Code Deploy) - Github Ation - deploy.yml 파일 작성 요령 및 appspec.yml 설정AWS 2023. 7. 30. 21:18
Github Actions를 사용하면 CICD를 구현함에 있어서 많은 편리한 기능이 제공된다. 먼저 우리가 코드를 수정하고 생성한 뒤, 해당 프로잭트를 github에 올리면, 우리가 만들어놓은 deploy.yml 파일의 설정에 따라 최신코드가 반영되고 이를 배포할 수 있게 된다. Github Actions을 사용하기 위해선, deploy.yml파일을 작성을 해야하는데 해당 경로를 .github/workflows 하위에 작성하여야 한다. 참고 링크 https://docs.github.com/ko/actions/learn-github-actions/understanding-github-actions GitHub Actions 이해 - GitHub Docs GitHub Actions is a continuou..
-
CICD (GitHubActions + EC2 + RDS + S3 + Code Deploy) - Code Deploy 설정AWS 2023. 7. 30. 20:42
Code Deploy를 설정해주기 위해서 먼저 iam 권한을 만들어준다. IAM 권한 생성을 만들고 나면, Code Deploy 설정을 한다. 어플리케이션 생성 배포 그룹을 생성한다. EC2 서버와 Code Deploy 를 mapping을 한다. 여기서 다양한 설정을 할 수 있다. 1. EC2 Auto Scaling 그룹을 선택하기 2. 로드 벨런서 활성화 필요에 따라 선택을 하면 된다!
-
CICD (GitHubActions + EC2 + RDS + S3 + Code Deploy) - S3 설정AWS 2023. 7. 30. 20:27
S3 기본이 글로벌 설정에서 시작. 버킷의 이름은 고유한 값을 세팅하고, AWS 리전 선택을 원하는 지역을 선택하면 된다. S3는 모든 지역에서 접근이 가능하다. 때문에 과금을 방지하기 위해서, "모든 퍼블릭 액세스 차단" 설정을 해주어야 한다. S3에 부여할 IAM 권한을 설정한다. 엑세스 키를 발급 받고 이를 저장한다. 해당 엑세스 키는 Code Deploy 실행파일에 작성할 때, 사용된다.
-
CICD (GitHubActions + EC2 + RDS + S3 + Code Deploy) - EC2 설정 정리AWS 2023. 7. 30. 19:29
EC2 설정 인스턴스 시작하기 1. 운영환경 : UBUNTU 로 인스턴스 생성하기. 유형 : 프리 티어로 사용 2. 키페어(로그인) : .pem key 만들기 : 나의 ec2서버에 접속하기 위한 키. 해당 .pem key파일은 잘 관리를 해야한다. 3. 네트워크 설정 : 기본 4. 스토리지 구성 : 프리티어를 사용하는 유저의 경우 최대 30gb까지 허용을 해주고 있다. 5. 요약: 인스턴스의 갯수를 설정할 수 있는데, 이 때 EC2 Auto Scaling 고려하여 인스턴스를 1개 이상 세팅이 가능 태그 지정 태그를 지정하는 이유는 나중에 code deploy와 연동을 할 때, 태그 그룹을 지정할 수 있다. 이 때, 우리의 ec2 서버의 정보를 알려주기 위해서 태그 값을 설정해주는 게 좋다.(기본은 나의 ..
-
7/4 ~ 7/12 이 전의 날들을 돌아보기회고/WIL 2023. 7. 12. 21:37
어떻게 지냈는가? 간단하게 말하자면, 약 9일간 정말 바쁘게 지내왔다. 9일 동안 나는 순수 JPA, Spring data JPA, JPQL, Querydsl 등을 학습하였고, 기존에 공부해온 Spring framework의 다양한 기능들을 연습하기 위해 게시판 CRUD를 만들면서 JWT 인증, Spring Security, Spring data JPA를 통한 다양한 연관관계를 풀어내보는 등의 작업을 해왔다. 다양한 기술들을 배우고 사용하고 원리를 알아가면서 의미 있는 시간을 보내긴 했지만, 한편으로는 나의 위치가 아직은 더 많은 것들을 배워야한다는 생각에 조금은 좋아만 할 수는 없는 차분해지는 시간도 많았다. 대학원을 다니다가 내가 정말로 하고 싶은 일이 무엇인지 고민하다 개발의 세계에 들어온지 1년이..