TIL.
-
인덱스TIL. 2024. 5. 30. 22:03
데이터베이스 인덱스는 데이터베이스 테이블의 검색 성능을 향상시키기 위한 자료구조이다. 특정 컬럼에 인덱스를 생성하면 해당 컬럼의 데이터들이 정렬되어 별도의 메모리 공간에 데이터의 물리적 주소와 함께 저장된다.장점테이블의 조회 속도를 향상시킨다. 인덱스를 통해 데이터의 물리적 주소를 먼저 확인하여 불필요한 테이블 풀스캔을 방지할 수 있다.부등호() 연산을 포함한 조건 검색 쿼리의 효율성이 높아진다. 정렬된 인덱스를 활용하여 범위 검색이 가능해진다.정렬 작업의 부하를 줄일 수 있다. 인덱스에 미리 정렬된 데이터가 저장되어 있어 ORDER BY 절 사용 시 별도 정렬이 필요 없다.전반적인 시스템 부하를 줄일 수 있다.단점인덱스 생성 및 관리를 위한 추가 저장 공간과 쓰기 작업이 필요하다.데이터 변경(INSER..
-
데이터 모델링TIL. 2024. 5. 29. 20:53
데이터 모델링이란 ?데이터 모델링은 조직의 정보 수집과 관리 시스템을 정의하는 시각적 표현 혹은 규격을 생성하는 단계이다. 이 때 만들어진 데이터 모델은 한 프로젝트의 다양한 이해관계자들이 조직의 데이터에 대한 통일된 개념을 가질 수 있도록 돕는다. 데이터 모델링은 해당 비즈니스가 수집하는 데이터, 데이터 간의 연간 관계, 데이터를 저장하고 분석할 때 사용되는 방식을 설명한다. 데이터 모델링이 중요한 이유 ? 오늘날 조직은 다양한 소스에서 많은 양의 데이터를 수집한다. 여기서 수익성 있는 비즈니스 결정을 위해서는도움이 되는 실행 가능한 인사이트를 얻기 위해서 데이터를 분석해야 한다. 정확한 데이터 분석을 위해서 효율적인 데이터를 수집, 저장, 처리하는 과정이 필요하다. 여러 데이터 베이스 관련한 기술과 ..
-
PrismaTIL. 2024. 5. 28. 23:53
Prisma란? Prisma는 Node.js, TypeScript, Rust, Go 등 다양한 언어와 프레임워크에서 사용할 수 있는 ORM(Object-Relational Mapping) 도구로, 데이터베이스와 애플리케이션 간의 상호작용을 단순화시켜 개발자가 SQL 쿼리를 직접 작성하지 않더라도 데이터베이스를 쉽게 다룰 수 있도록하여 데이터베이스의 접근성과 생산성을 높여준다.특히 Prisma는 ORM 중에서도 현대적이고 선언적인 구문을 사용하기 때문에 SQL 쿼리 복잡성을 줄이고, 안전한 쿼리 작성을 보장한다. Prisma의 주요 구성 요소Prisma Client: Node.js 및 TypeScript용 자동 생성된 타입 안전 쿼리 빌더이다. 데이터베이스에 대한 CRUD 작업을 수행할 수 있습니다.Pr..
-
HTTP Status Code (추가예정)TIL. 2024. 5. 27. 23:18
HTTP 응답 상태 코드는 특정 HTTP 요청이 성공적으로 완료되었는지 여부를 나타낸다. 전송되는 컨텐트의 상태를 설명하고 서버에서 클라이언트로 전달되는 정보의 출처를 나타낸다. 1. 정보 응답 (100-199)임시 응답으로 현재 클라이언트의 요청까지는 처리되었으니 게속 진행하라는 의미2. 성공적인 응답 (200-299)클라이언트의 요청이 서버에서 성공적으로 처리되었다.3. 리다이렉션 메세지 (300-399)완전한 처리를 위해서 추가 동작이 필요한 경우이다. 주로 서버의 주소 또는 요청한 URI의 웹 문서가 이동되었으니 그 주소로 다시 시도하라는 의미를 가진다.4. 클라이언트 오류 응답 (400-499)없는 페이지를 요청하는 등 클라이언트의 요청 메시지 내용이 잘못된 경우를 의미한다.5. 서버 오류 응..
-
BcryptTIL. 2024. 5. 24. 23:45
단방향 암호화단방향 암호화는 평문을 암호화 할 수는 있지만 암호화 된 문자를 다시 평문으로 복호화가 불가능한 방식이다. 해시 함수를 사용하여 임의의 길이 메세지를 고정된 길이의 해시값으로 변환하게 되며 동일한 입력값에 대해서 항상 동일한 해시값을 출력하게 된다.단방향 암호화를 사용하는 주된 이유는 메시지 또는 파일의 무결성을 보장하기 위해서이며 원본의 값이 1bit라도 달라지게 된다면,해시 알고리즘을 통과한 후의 해시값은 매우 높은 확률로 달라지게 된다. 이를 통해 메세지나 파일의 원본 여부를 파악할 수 있다. 단방향 암호화의 한계해시 알고리즘은 동일한 평문에 대하여 항상 동일 해시값을 갖는다. 따라서 특정 해시 알고리즘에 대해 특정 평문이 어떤 해시값을 갖는지 알 수 있다. 이런 특징을 이용하여 해시 ..
-
JWT (Json Web Token)TIL. 2024. 5. 23. 23:47
JWT란 ?JWT(json web token)는 Json 포맷을 이용하여 서버와 클라이언트 사이에서 사용자 인증 정보를 안전하게 전달하기 위한 웹 토큰 표준이다. 특징 토큰 자체에 인증에 필요한 정보가 포함되어 있어 데이터베이스 조회가 필요하지 않다.토큰은 헤더, 페이로드, 시그니처로 구성된다.누구든지 JWT 내부에 들어있는지 정보를 확인할 수 있다.JWT가 인증 서버에서 발급되었는지 위변조 여부를 확인 가능하다. 구성요소 Header : 토큰의 타입, 해시 암호화 알고리즘이 포함되어 있다.타입은 토큰의 유형을 나타내며 해시 암호화 알고리즘에는 SHA256, RSA, HMAC과 같은 해시 암호화 알고리즘을 나타낸다.Payload : 토큰에 담을 클레임 (claim) 정보를 포함한다. 페이로드에 담는 정보..
-
트랜잭션TIL. 2024. 5. 22. 23:41
트랜잭션이란 ? 트랜잭션이란 데이터베이스의 상태를 바꾸는 작업의 논리적 단위이다. MySQL에서 입력하는 쿼리문은 입력과 동시에 처리되어 데이터베이스에 반영되는데 여기서 작업단위는 한 가지 쿼리를 뜻하는 게 아닌 한 동작에 필요한 여러 개의 쿼리문을 의미한다. 트랜잭션의 특징(ACID)트랜잭션의 특징은 크게 네 가지로 구분된다.원자성 (Atomicity)트랜잭션에 속한 각각의 쿼리(CRUD)를 하나의 단위로 취급하는 작업단위는 전부 반영되거나 어느 하나라도 오류가 발생한다면 트랜잭션 전체가 취소되어야 한다. 일관성 (Consistency)작업 처리 결과는 일관성을 가져야한다. 테이블에 변경 사항을 적용할 때 미리 정의된, 예측할 수 있는 방식만을 사용하고 트랜잭션 수행 전이나 후에 데이터 모델이 갖고 ..
-
쿠키TIL. 2024. 5. 21. 23:52
쿠키란 ? 쿠키는 웹 브라우저가 웹사이트를 방문할 때 서버로부터 전송받은 데이터 조각이며,사용자의 효율적이고 안전한 웹 사용을 위하여 사용된다. 브라우저는 이 데이터를 저장해 두었다가 동일한 웹사이트를 다시 방문할 때 저장된 데이터를 함께 전송한다. 쿠키의 주요 역할기능 쿠키 : 웹사이트에 방문한 접속자의 설정을 저장하고 설정에 맞춰 동작하게끔 한다. 설정은 접속자의 지역 및 언어 등을 포함한다. 성능 쿠키 : 쿠키는 정보의 익명 수집 및 보고를 통해 웹사이트와 방문자 사이의 상호작용을 이해하는데 도움을 준다. 또한 상호관계에 대한 통계자료를 제공함으로써 웹사이트 운영자가 더욱 최적화된 웹사이트를 개발하는데 기여한다. 마케팅 쿠키 : 쿠키는 방문자의 방문 내역을 추적하며, 방문자의 경향 및 웹사이트 이..