본문 바로가기

분류 전체보기160

[Spring] 스프링 3.3에서 추가된 `pageSerializationMode = VIA_DTO` (JPA의 `Pageable`, `Page` 인터페이스 자체를 잘 안쓰긴 하지만)해당 스펙 PR 링크(https://github.com/spring-projects/spring-boot/pull/39797)   스프링 3.3으로 자료를 만들다가 처음 보는 WARN 로그가 보였다.2024-08-26T15:13:27.588+09:00 WARN 63105 --- [todo] [nio-8080-exec-2] PageModule$PlainPageSerializationWarning : Serializing PageImpl instances as-is is not supported, meaning that there is no guarantee about the stability of the resulting J.. 2024. 8. 26.
[Rust] 재밌는 enum enum Color { Red, Yellow, Blue,}fn print_color(color: Color) { match color { Color::Red => println!("Red"), Color::Yellow => println!("Yellow"), Color::Blue => println!("Blue"), }}fn main() { print_color(Color::Red);}  이러한 Rust 코드를 실행시켜보면, 이렇게 맨 아래에 Red가 출력되긴 하지만, 재밌게도 'variants `Yellow` and `Blue` are never constructed' 라는 warning이 나온다.enum Color 중 Yellow와.. 2024. 8. 26.
[암호학] bcrypt 동작 방식 bcrypt의 작동 방식salt가 매번 다르게 생성됨bcrypt는 비밀번호를 hashing할 때마다 무작위로 새로운 salt를 생성한다. 그래서 같은 비밀번호라도 hashing할 때마다 다른 결과가 나온다.해시 값에 솔트 포함bcrypt로 만든 hash 값에는 salt도 함께 저장된다. 이 덕분에 salt를 따로 보관할 필요가 없다. 검증할 때는 이 hash 값에서 salt를 추출해 사용한다. 비밀번호가 같아도 다른 hash 값같은 비밀번호라도 salt가 달라지면 완전히 다른 hash 값이 나온다. 예를 들어 "password123"이라는 비밀번호를 두 번 해싱하면,첫 번째 해시: $2b$12$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx두 번째 해시: .. 2024. 8. 22.
USE 방법론과 RED 방법론 USE 방법론 (The USE Method)시스템을 운영하다 보면 예상치 못한 성능 저하 문제를 자주 겪게 된다. 이런 문제의 원인을 파악하기 위해 사용되는 방법 중 하나가 USE 방법론이다. 이 방법론은 시스템의 모든 자원(resource)에 대해 점유율(utilization), 포화율(saturation), 오류(errors)를 분석하는 것을 목표로 한다.Resource(자원): 서버의 하드웨어나 소프트웨어 자원 (예: CPU, 디스크, 메모리 등).Utilization(점유율): 자원이 얼마나 바쁘게 사용되고 있는가를 나타내는 지표. 높은 점유율은 병목 현상을 시사한다.Saturation(포화율): 자원이 처리하지 못한 작업이 얼마나 많은지를 보여주는 지표. 포화율이 높으면 대기 작업이 많다는 의미.. 2024. 8. 22.
[k8s] pod의 env가 ConfigMap 참조하도록 설정 # 수정 전spec: containers: - env: - name: APP_COLOR value: green    # 수정 후spec: containers: - env: - name: APP_COLOR valueFrom: configMapKeyRef: name: configmap.yaml key: APP_COLOR         ConfigMap 예시apiVersion: v1kind: ConfigMapmetadata: name: my-config namespace: defaultdata: APP_COLOR: "blue" APP_ENV: "production" APP_TIMEOUT: "30" 2024. 8. 18.