RDS(6)
-
nestjs prisma 사용해보기 with AWS RDS
1. Prisma 란? Prisma Client : NodeJS 와 TypeScript 전용 Type Safe 및 자동 생성 쿼리 빌더 Prisma Migrate : Migration system, 데이터 모델링 Prisma Studio : GUI 를 통해 DB 를 수정할 수 있는 기능 -Prisma Docs- 2. 왜 Prisma 를 사용하는가 Prisma 의 목적은 데이터베이스 작업 시 개발자의 생산성을 높이는 것이다. 관계형 데이터를 매핑하는 것 대신 객체를 사용 복잡한 모델 객체를 피하기 위해 클래스가 아닌 쿼리를 사용 데이터베이스 및 어플리케이션 모델을 위한 Single source of Truth 이론(정보의 중복, 비적 합성 등의 문제를 해결하기 위한 이론) 흔한 함정과 안티패턴을 막기 위한..
2023.12.04 -
EC2 에 띄운 NestJS app & postgreSQL RDS
postgreSQL 로 RDS 를 생성해준다. https://muyeon95.tistory.com/196 RDS 사용하기 [ with mysql ] https://ap-northeast-2.console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin®ion=ap-northeast-2 https://ap-northeast-2.console.aws.amazon.com/console/home?nc2=h_ct®ion=ap-northeast-2&src=header-signin ap-northeast-2.console.aws.amazon.com 위 muyeon95.tistory.com Dockerfile FROM node:18 WORKDIR /usr/src/app..
2023.08.14 -
[Nest] 35 - 08/12/2023, 3:47:41 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...Error: connect ETIMEDOUT <아이피:포트> at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
문제 상황 EC2 인스턴스에 nest.js 앱과 rds 를 연결하던 중 발생했던 오류이다. [Nest] 35 - 08/12/2023, 3:47:41 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... Error: connect ETIMEDOUT at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) 첫번째 SOLVE rds 의 인바운드 규칙(0.0.0.0 & ::/0)을 모두 허용했더니 성공했다. 하지만 정확한 원인을 모르겠다. 로그에 적힌 IP 를 규칙 허용 했음에도 불구하고 이런 현상이 발생한 원인을 찾아보자 저 IP 가 어디에서 왔는지 찾아보았다. sud..
2023.08.14 -
ERROR [ExceptionsHandler] relation "goods_entity" does not existQueryFailedError: relation "goods_entity" does not exist
문제 상황 EC2 우분투 환경에서 docker 로 올려놓은 nest.js 와 RDS 를 연결해 실행했을 때 나왔던 오류이다. [Nest] 37406 - 2023. 08. 10. 오전 6:16:27 ERROR [ExceptionsHandler] relation "goods_entity" does not exist QueryFailedError: relation "goods_entity" does not exist at PostgresQueryRunner.query (/Users/yunmun-yeol/Documents/nestjs/TicketNest-dev/src/driver/postgres/PostgresQueryRunner.ts:299:19) at processTicksAndRejections (node..
2023.08.10 -
error: no pg_hba.conf entry for host “비밀스런 IP”, user “비밀스런 유저 이름”, database “비밀스런 DB 이름 “, no encryption at Parser.parseErrorMessage (/Users/yunmun-yeol/Documents/nestjs/TicketNest-dev/node_modules/pg-p..
문제 상황 postgreSQL 을 사용한 RDS 를 로컬에서 테스트를 하려고 하던중 발생한 에러이다. error: no pg_hba.conf entry for host “비밀스런 IP”, user “비밀스런 유저 이름”, database “비밀스런 DB 이름 “, no encryption at Parser.parseErrorMessage (/Users/yunmun-yeol/Documents/nestjs/TicketNest-dev/node_modules/pg-protocol/src/parser.ts:369:69) at Parser.handlePacket (/Users/yunmun-yeol/Documents/nestjs/TicketNest-dev/node_modules/pg-protocol/src/parse..
2023.08.10 -
RDS 사용하기 [ with mysql ]
https://ap-northeast-2.console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin®ion=ap-northeast-2 https://ap-northeast-2.console.aws.amazon.com/console/home?nc2=h_ct®ion=ap-northeast-2&src=header-signin ap-northeast-2.console.aws.amazon.com 위 의 링크 접속 후 RDS 를 검색 클릭 후 데이터베이스 생성 클릭 DB 인스턴스 구성과 스토리지는 설정 그대로 두고 넘어간다. 이후 데이터베이스 생성 클릭 RDS 포트 열어주기 express-database 클릭 보안 그룹 ID 클릭 인바운드 규칙 편집 아래처..
2023.06.30