Files
Resume/dist/03-performance-db.html
T
DongHyeonkaandClaude Opus 5 a80bccd99d chore: 이력서 레포 git 초기화
직무 트랙별 이력서(md), PDF 변환 스크립트, 생성된 dist 산출물 추가.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 13:27:16 +09:00

210 lines
9.6 KiB
HTML

<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>03-performance-db</title>
<style>:root {
color-scheme: light;
--ink: #1f2933;
--muted: #52616b;
--rule: #d8dee4;
--accent: #0f766e;
--soft: #eef7f5;
}
@page {
size: A4;
margin: 10mm 12mm 11mm;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
background: #ffffff;
color: var(--ink);
font-family: "Noto Sans CJK KR", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
font-size: 8.9pt;
line-height: 1.38;
word-break: keep-all;
overflow-wrap: break-word;
}
main {
max-width: 190mm;
margin: 0 auto;
}
h1,
h2,
h3 {
margin: 0;
line-height: 1.25;
letter-spacing: 0;
}
h1 {
padding-bottom: 2.8mm;
border-bottom: 2px solid var(--accent);
font-size: 18.5pt;
font-weight: 800;
}
h2 {
margin-top: 4.6mm;
padding-bottom: 1.1mm;
border-bottom: 1px solid var(--rule);
color: var(--accent);
font-size: 12.1pt;
font-weight: 800;
}
h3 {
margin-top: 3.6mm;
font-size: 10.4pt;
font-weight: 800;
}
.project {
display: block;
break-inside: avoid;
}
.project h3 {
margin-top: 3.8mm;
}
.project:first-of-type h3 {
margin-top: 3mm;
}
p {
margin: 1.7mm 0;
}
a {
color: #0b5cad;
text-decoration: none;
}
hr {
height: 1px;
margin: 3mm 0;
border: 0;
background: var(--rule);
}
table {
width: 100%;
margin: 2mm 0 3mm;
border-collapse: collapse;
font-size: 8.7pt;
}
td,
th {
padding: 1mm 1.6mm;
border-bottom: 1px solid var(--rule);
text-align: left;
vertical-align: top;
}
td:first-child,
th:first-child {
width: 23mm;
color: var(--muted);
font-weight: 700;
}
blockquote {
margin: 1.7mm 0;
padding: 1.5mm 2.2mm;
border-left: 3px solid var(--accent);
background: var(--soft);
color: #334e4a;
}
blockquote p {
margin: 0.8mm 0;
}
ul {
margin: 1.4mm 0 2.2mm;
padding-left: 4.4mm;
}
li {
margin: 0.75mm 0;
padding-left: 0.5mm;
}
strong {
font-weight: 800;
}
code {
padding: 0.1mm 0.7mm;
border-radius: 2px;
background: #f3f4f6;
color: #1f2937;
font-family: "JetBrains Mono", "D2Coding", Consolas, monospace;
font-size: 0.92em;
}
h3 + blockquote {
margin-top: 1.2mm;
}
blockquote + p,
blockquote + ul {
margin-top: 1.6mm;
}
h2,
h3,
blockquote,
table {
break-after: avoid;
}
li,
blockquote,
tr {
break-inside: avoid;
}
</style>
</head>
<body>
<main>
<h1>강동현 · 백엔드 신입 (성능 / DB)</h1>
<table><tbody><tr><td></td><td></td></tr><tr><td>Email</td><td>donghyeonka68@gmail.com</td></tr><tr><td>GitHub</td><td><a href="https://github.com/donghyeon-ka">github.com/donghyeon-ka</a></td></tr><tr><td>Velog</td><td><a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></td></tr></tbody></table>
<hr>
<h2>Summary</h2>
<p>PostgreSQL 쿼리 분석과 인덱스 설계에 관심을 두고, 피드 목록 조회 쿼리를 EXPLAIN ANALYZE 기준으로 분석해 1.77 초 → 7.66 ms 까지 단계적으로 개선한 경험이 있는 신입 백엔드 개발자입니다.</p>
<p>Redis 2 단계 캐시와 Locust 부하 테스트로 검증 흐름을 정리했고, JPA fetch 전략 / Flyway 마이그레이션 / 트랜잭션 위치 등 데이터 레이어 책임 경계도 함께 정리했습니다.</p>
<p>모든 성능 수치는 로컬 실험 및 단일 인스턴스 부하 테스트 기준으로 정리했습니다.</p>
<hr>
<h2>Skills</h2>
<p><strong>Main</strong></p>
<ul><li>PostgreSQL 16, EXPLAIN ANALYZE, 복합 / 커버링 인덱스 설계, Redis, Locust</li></ul>
<p><strong>Used in Projects</strong></p>
<ul><li>Spring Data JPA (fetch 전략, N+1 회피), Flyway (V1~V5), 외부 정렬 / Bitmap Heap Scan / Hash Join 분석, p50 / p95 / p99 latency 측정</li></ul>
<p><strong>Backend (보조)</strong></p>
<ul><li>Java 21, Spring Boot 4, Spring Security Resource Server, ArchUnit</li></ul>
<hr>
<h2>Projects</h2>
<section class="project"><h3>feed-postgresql-query-tuning — PostgreSQL 쿼리 튜닝</h3><blockquote><p>개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증 모든 수치는 EXPLAIN ANALYZE 기준 쿼리 실행 시간 <a href="https://github.com/donghyeon-ka/feed-postgresql-query-tuning">github.com/donghyeon-ka/feed-postgresql-query-tuning</a></p></blockquote><p>피드 목록 조회 쿼리를 EXPLAIN ANALYZE 기준으로 분석하고, JOIN 구조 / 인덱스 설계 / 캐시 전략 / 부하 검증 순으로 단계적으로 개선한 프로젝트입니다.</p><ul><li>피드 목록 조회 쿼리 응답 시간 <strong>1.77 초 → 7.66 ms</strong> 까지 단계적으로 개선</li><li><strong>원인 분석</strong> (EXPLAIN ANALYZE) — 4-table LEFT JOIN 으로 인한 데이터 폭증, 인덱스 미사용으로 인한 sequential scan, 디스크 기반 외부 정렬 (<code>Sort Method: external merge Disk</code>) 발생 확인</li><li><strong>1 차 개선</strong> — 불필요한 LEFT JOIN 을 <code>EXISTS</code> 서브쿼리로 교체 + 페이지네이션 쿼리 분리 → <strong>1.77 초 → 0.216 초</strong> (8 배)</li><li><strong>2 차 개선</strong> — 정렬 키 + WHERE 절 컬럼을 합친 복합 인덱스 + 자주 SELECT 되는 컬럼 포함 커버링 인덱스 → <strong>0.216 초 → 7.66 ms</strong> (28 배). 인덱스 기반 조회로 디스크 접근과 정렬 비용을 줄임</li><li><strong>캐시 전략</strong> — Redis 2 단계 캐시 (공개 피드만 캐시, private 피드는 우회) 도입. 부하 테스트 구간에서 캐시 히트율 약 <strong>90%</strong> 관찰</li><li><strong>부하 검증</strong> — 단일 인스턴스 환경에서 Locust 로 동시 1,000 명 시나리오 → <strong>900~1,100 RPS</strong> (구간별 latency p50 / p95 / p99 측정)</li><li><strong>JPA 측면</strong> — N+1 회피, fetch 전략 명시 (LAZY + 필요 시 명시적 join fetch), Spring Data Page 의 count 쿼리 분리</li></ul><p><code>PostgreSQL</code> <code>JPA</code> <code>EXPLAIN ANALYZE</code> <code>Index design</code> <code>Redis</code> <code>Locust</code> <code>Spring Boot</code></p></section>
<section class="project"><h3>Project-Auth-Server — Spring Boot 인증 서버 (DB 측면)</h3><blockquote><p>개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증 <a href="https://github.com/donghyeon-ka/project-auth-server">github.com/donghyeon-ka/project-auth-server</a></p></blockquote><p>Spring Boot 인증 서버 프로젝트 — 본 트랙에서는 PostgreSQL 스키마 / JPA / Flyway / 트랜잭션 경계 등 데이터 레이어 관련 결정 중심으로 정리합니다.</p><ul><li><strong>Flyway V1~V5 단계적 마이그레이션</strong> — <code>auth</code> 스키마, 사용자 도메인 + Keycloak provider 통합 컬럼 (<code>provider</code>, <code>provider_subject</code>, <code>KEYCLOAK</code> 단일 값으로 고정) 까지 5 단계로 분리</li><li><strong>트랜잭션 경계는 application use case 가 소유</strong> — <code>infrastructure</code> adapter 가 <code>@Transactional</code> 을 들고 있던 구조를 ADR 로 정리해 application 레이어로 이동</li><li><strong>infrastructure → domain 복원 시 무결성 보호</strong> — <code>JpaUserRepositoryAdapter</code> 가 row → User 복원 중 <code>DomainException</code> 등이 발생하면 <code>InfrastructureException(PERSISTED_DATA_INVALID)</code> 로 번역 (잘못된 저장 데이터를 비즈니스 검증 실패가 아니라 인프라 무결성 문제로 분류)</li><li><strong>DB row 와 도메인 값 객체 분리</strong> — <code>User</code>, <code>UserEmail</code>, <code>UserName</code> 등 VO 의 invariant 가 entity 와 별도로 검증</li></ul><p><code>PostgreSQL</code> <code>JPA</code> <code>Flyway</code> <code>Spring Boot</code> <code>ArchUnit</code></p></section>
<section class="project"><h3>Project-Infra — 데이터 저장소와 책임 분리</h3><blockquote><p>개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 로컬 / dev 환경 구성 <a href="https://github.com/donghyeon-ka/project-infra">github.com/donghyeon-ka/project-infra</a></p></blockquote><p>auth-server 가 동작하는 K3s 환경에서 데이터 저장소 (PostgreSQL / MinIO / Docker Registry) 책임을 분리해 구성한 프로젝트입니다.</p><ul><li><strong>Postgres + MinIO + Docker Registry 책임 분리</strong> — 애플리케이션 row 데이터는 PostgreSQL, object storage 는 MinIO, Docker Registry 는 자체 PV 없이 MinIO S3 backend 위임</li><li>Flyway 마이그레이션 Job 을 앱보다 먼저 실행되도록 분리하고, GitOps 적용 시 PreSync / sync-wave 로 배포 순서를 제어할 수 있게 구성</li><li>외부 push 인증은 Traefik Middleware BasicAuth, 내부 pull 은 K8s imagePullSecret 으로 책임 경계 분리</li></ul><p><code>PostgreSQL</code> <code>MinIO</code> <code>Docker Registry</code> <code>Flyway</code> <code>Kustomize</code></p><hr></section>
<h2>Blog</h2>
<ul><li><a href="https://velog.io/@donghyeon2">Velog @donghyeon2</a> — 기술적 의사결정 과정과 트러블슈팅 경험 기록</li></ul>
<hr>
<h2>Links</h2>
<ul><li><strong>GitHub</strong>: <a href="https://github.com/donghyeon-ka">github.com/donghyeon-ka</a></li><li><strong>쿼리 튜닝 (메인)</strong>: <a href="https://github.com/donghyeon-ka/feed-postgresql-query-tuning">feed-postgresql-query-tuning</a></li><li><strong>인증 서버</strong>: <a href="https://github.com/donghyeon-ka/project-auth-server">project-auth-server</a></li><li><strong>인프라</strong>: <a href="https://github.com/donghyeon-ka/project-infra">project-infra</a></li></ul>
</main>
</body>
</html>