chore: 이력서 레포 git 초기화
직무 트랙별 이력서(md), PDF 변환 스크립트, 생성된 dist 산출물 추가. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
# Node
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
package-lock.json
|
||||
|
||||
# OS / editor
|
||||
.DS_Store
|
||||
*.swp
|
||||
|
||||
# dist/ 는 추적함 (생성된 PDF·HTML 을 레포에서 바로 내려받기 위함)
|
||||
@@ -0,0 +1,89 @@
|
||||
# 강동현 · 백엔드 신입 (Java / Spring)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Email | donghyeonka68@gmail.com |
|
||||
| GitHub | [github.com/donghyeon-ka](https://github.com/donghyeon-ka) |
|
||||
| Blog | [velog.io/@donghyeon2](https://velog.io/@donghyeon2) |
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Java / Spring Boot 기반 백엔드에서 인증, 계층 분리, 예외 응답 표준화, 데이터 영속성 경계에 집중해 학습해 온 신입 백엔드 개발자입니다.
|
||||
|
||||
Spring Boot 인증 서버를 5 개 모듈 Clean / Hexagonal 구조로 나누고, `domain` 모듈이 Spring / JPA / Servlet에 의존하지 않도록 분리했습니다. 또한 ArchUnit 테스트로 계층 의존성을 검증하고, Keycloak JWT를 Resource Server로 다시 검증하는 구조를 구현했습니다.
|
||||
|
||||
프로젝트는 개인 로컬 / dev 환경 기준입니다. 대신 구현 범위, 검증 범위, 아직 운영 경험으로 볼 수 없는 부분을 문서 안에서 구분했습니다.
|
||||
|
||||
---
|
||||
|
||||
## Skills
|
||||
|
||||
**Core**
|
||||
- Java 21, Spring Boot 4, Spring Security Resource Server, Spring Data JPA, PostgreSQL 16
|
||||
|
||||
**Architecture / Testing**
|
||||
- Clean Architecture, Hexagonal Architecture, Gradle multi-project, ArchUnit, JUnit 5, AssertJ
|
||||
|
||||
**Auth / Observability**
|
||||
- Keycloak, OAuth2 / OIDC, JWKS 기반 JWT 검증, Flyway, OpenAPI / Swagger UI, MDC `traceId` 기반 structured logging
|
||||
|
||||
---
|
||||
|
||||
## Projects
|
||||
|
||||
### Project-Auth-Server — Spring Boot 인증 서버
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
|
||||
Spring Boot 인증 서버를 계층별 책임이 드러나도록 분리하고, 인증 위임 / JWT 검증 / 예외 응답 / DB 마이그레이션 경계를 정리한 프로젝트입니다.
|
||||
|
||||
- Gradle multi-project로 `domain` / `application` / `presentation` / `infrastructure` / `bootstrap` 5 개 모듈을 분리했습니다.
|
||||
- `domain` 모듈은 Spring, JPA, Servlet 의존성을 두지 않고 값 객체와 도메인 규칙만 포함하도록 구성했습니다.
|
||||
- ArchUnit의 `LayerDependencyArchitectureTest`로 `presentation → infrastructure` 같은 계층 위반을 빌드 단계에서 탐지하도록 했습니다.
|
||||
- 로그인 플로우는 Keycloak / Ingress 계층에 위임하고, 백엔드는 `oauth2-resource-server`로 JWT issuer / signature / expiration / role claim을 다시 검증하도록 구성했습니다.
|
||||
- `ErrorCode`는 비즈니스 의미만 담고, HTTP status 매핑은 presentation의 mapper가 담당하도록 분리했습니다.
|
||||
- 예외 처리는 Security filter, Spring MVC 입력 검증, application, infrastructure 누수 감지로 나눴고, 응답은 `ApiResult<T>` 형태로 통일했습니다.
|
||||
- `TraceIdFilter`로 32 자리 hex `traceId`를 응답 헤더, 로그, audit 흐름에 동일하게 전파했습니다.
|
||||
- Flyway V1~V5로 `auth` 스키마와 사용자 / provider 관련 변경을 단계별 마이그레이션으로 관리했습니다.
|
||||
|
||||
`Java 21` `Spring Boot` `Spring Security` `Keycloak` `JPA` `PostgreSQL` `ArchUnit` `Flyway`
|
||||
|
||||
### feed-postgresql-query-tuning — PostgreSQL 쿼리 최적화
|
||||
|
||||
> 개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증
|
||||
> [github.com/donghyeon-ka/feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
|
||||
피드 목록 조회 쿼리를 실행 계획 기준으로 분석하고, JOIN 구조와 인덱스 설계를 바꿔 성능을 개선한 프로젝트입니다.
|
||||
|
||||
- `EXPLAIN ANALYZE` 기준 피드 목록 조회 쿼리 실행 시간을 **1.77 s → 7.66 ms**로 개선했습니다.
|
||||
- 4-table `LEFT JOIN`에 따른 row 폭증, 인덱스 미사용, 디스크 기반 외부 정렬을 병목으로 확인했습니다.
|
||||
- `EXISTS` 서브쿼리, 페이지네이션 쿼리 분리, 복합 / 커버링 인덱스를 단계적으로 적용했습니다.
|
||||
- 단일 인스턴스 환경에서 Locust 1,000 동시 사용자 시나리오를 실행해 약 **900~1,100 RPS** 구간을 확인했습니다.
|
||||
|
||||
`PostgreSQL` `EXPLAIN ANALYZE` `Index design` `JPA` `Redis` `Locust`
|
||||
|
||||
### Project-Infra — Spring 앱 실행 환경
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 로컬 / dev 환경 구성
|
||||
> [github.com/donghyeon-ka/project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
|
||||
auth-server가 동작하는 로컬 / dev K3s 환경을 구성하면서 백엔드와 인프라의 인증 책임을 분리한 프로젝트입니다.
|
||||
|
||||
- Traefik ForwardAuth + oauth2-proxy + Keycloak으로 로그인 / 세션 확인을 Ingress 계층에 두고, auth-server는 JWT 검증에 집중하도록 구성했습니다.
|
||||
- Vault → VSO → Kubernetes Secret 흐름으로 secret 주입 책임을 애플리케이션 코드 밖으로 분리했습니다.
|
||||
- Kustomize base / overlay 구조로 로컬과 dev 환경 차이를 manifest 단에서 관리했습니다.
|
||||
|
||||
`Kubernetes` `K3s` `Kustomize` `Vault` `VSO` `Traefik`
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
- **GitHub**: [github.com/donghyeon-ka](https://github.com/donghyeon-ka)
|
||||
- **메인 프로젝트**: [project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
- **인프라**: [project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
- **쿼리 튜닝**: [feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
- **Blog**: [velog.io/@donghyeon2](https://velog.io/@donghyeon2)
|
||||
@@ -0,0 +1,94 @@
|
||||
# 강동현 · 백엔드 신입 (Java / Spring)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Email | donghyeonka68@gmail.com |
|
||||
| GitHub | [github.com/donghyeon-ka](https://github.com/donghyeon-ka) |
|
||||
| Velog | [velog.io/@donghyeon2](https://velog.io/@donghyeon2) |
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Java / Spring Boot 기반 백엔드 개발을 중심으로 학습하며, 인증 서버의 레이어 구조, 예외 응답 표준, 인증 위임 구조를 직접 구현해 온 신입 백엔드 개발자입니다.
|
||||
|
||||
Spring Security Resource Server 와 Keycloak JWT 검증 구조를 구성했고, Clean / Hexagonal Architecture 5 개 모듈과 ArchUnit 테스트로 계층 의존성을 검증했습니다.
|
||||
|
||||
프로젝트는 모두 개인 로컬 / dev 환경 기준이며, 구현 범위와 검증 범위를 구분해 문서화했습니다.
|
||||
|
||||
---
|
||||
|
||||
## Skills
|
||||
|
||||
**Main**
|
||||
- Java 21, Spring Boot 4.0.3, Spring Security Resource Server, JPA, PostgreSQL 16
|
||||
|
||||
**Used in Projects**
|
||||
- Keycloak, OAuth2 / OIDC, Nimbus JWT (JWKS), Flyway, ArchUnit, JUnit 5, AssertJ, OpenAPI / Swagger UI, MDC `traceId` 기반 structured logging
|
||||
|
||||
**Infrastructure (보조)**
|
||||
- Docker, K3s, Kustomize, Vault, VSO, Traefik
|
||||
|
||||
---
|
||||
|
||||
## Projects
|
||||
|
||||
### Project-Auth-Server — Spring Boot 인증 서버 (Clean / Hexagonal)
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
|
||||
Spring Boot 인증 서버를 Clean / Hexagonal Architecture 로 분리하고, Keycloak JWT 를 Resource Server 로 검증하는 구조를 구현한 프로젝트입니다.
|
||||
|
||||
- **5 모듈 Clean / Hexagonal Architecture** — `domain` / `application` / `presentation` / `infrastructure` / `bootstrap` 로 Gradle multi-project 분리. `domain` 은 Spring / JPA / Servlet 의존 0
|
||||
- **ArchUnit 으로 레이어 의존성 검증** — `LayerDependencyArchitectureTest` 가 빌드 단계에서 `presentation → infrastructure` 같은 위반을 검출. CI 연결 시 PR 게이트로 활용 가능한 구조
|
||||
- **`ErrorCode` 와 HTTP status 분리** — `BusinessException` 의 `ErrorCode` 는 비즈니스 의미만 (code + message), HTTP status 매핑은 presentation 의 `ApiErrorHttpStatusMapper` 가 담당
|
||||
- **Spring Security Resource Server + Keycloak** — `oauth2-client` 가 아니라 `oauth2-resource-server` 만 사용. Keycloak 발급 JWT 의 issuer / signature / expiration / role claim 을 백엔드에서 다시 검증
|
||||
- **Exception Handler 4 계층 분리** — 필터 단 (`SecurityExceptionHandler`) / Spring MVC 입력단 / application / infrastructure 누수 감지. 모든 응답은 `ApiResult<T>` (success · code · message · data · traceId · timestamp) 로 통일
|
||||
- **MDC `traceId` 일관성 + Flyway 마이그레이션 관리** — `TraceIdFilter` 가 32 자리 hex traceId 를 응답 헤더 / 로그 / audit 에 동일하게 전파. `auth` schema 의 V1~V5 SQL migration 을 infrastructure 모듈에서 관리
|
||||
|
||||
`Java 21` `Spring Boot 4.0.3` `Spring Security` `JPA` `PostgreSQL` `Keycloak` `ArchUnit` `Flyway`
|
||||
|
||||
### feed-postgresql-query-tuning — PostgreSQL 쿼리 튜닝 프로젝트
|
||||
|
||||
> 개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증 (수치는 모두 EXPLAIN ANALYZE 기준 쿼리 실행 시간)
|
||||
> [github.com/donghyeon-ka/feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
|
||||
피드 목록 조회 쿼리를 EXPLAIN ANALYZE 기준으로 분석하고, JOIN 구조 / 인덱스 설계 / 캐시 / 부하 검증 순으로 단계적으로 개선한 프로젝트입니다.
|
||||
|
||||
- 피드 목록 조회 쿼리 응답 시간 **1.77 초 → 7.66 ms** (단계적 개선 결과, EXPLAIN ANALYZE 기준)
|
||||
- **원인 분석** — 4-table LEFT JOIN 데이터 폭증 + 인덱스 미사용 + 외부 정렬 발생 확인
|
||||
- **1 차 개선** — 불필요한 JOIN 을 EXISTS 서브쿼리로 교체 + 쿼리 분리 → 1.77 초 → 0.216 초
|
||||
- **2 차 개선** — 복합 인덱스 + 커버링 인덱스 → 0.216 초 → 7.66 ms
|
||||
- **JPA 측면** — N+1 회피, fetch 전략 명시 (LAZY + 필요 시 명시적 join fetch)
|
||||
- **부하 검증** — 단일 인스턴스 환경에서 Locust 동시 1,000 명 부하 → 900~1,100 RPS
|
||||
|
||||
`PostgreSQL` `JPA` `EXPLAIN ANALYZE` `Index design` `Redis` `Locust`
|
||||
|
||||
### Project-Infra — Spring 앱 실행 환경 구성
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 로컬 / dev 환경 구성
|
||||
> [github.com/donghyeon-ka/project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
|
||||
auth-server 가 동작하는 로컬 / dev K3s 환경을 Kustomize overlay 로 구성하고, Ingress 인증 게이트와 시크릿 주입 흐름을 함께 설계한 프로젝트입니다.
|
||||
|
||||
- auth-server 가 동작하는 로컬 / dev K3s 실행 환경을 Kustomize overlay 로 구성
|
||||
- Traefik ForwardAuth + oauth2-proxy + Keycloak 으로 로그인 / 세션 확인 경계를 분리하고, auth-server 는 JWT 검증에 집중하도록 구성
|
||||
- Vault → VSO → Kubernetes Secret 흐름으로 secret 주입 구조 구성
|
||||
|
||||
`Kubernetes (K3s)` `Kustomize` `Vault` `VSO` `Traefik`
|
||||
|
||||
---
|
||||
|
||||
## Blog
|
||||
|
||||
- [Velog @donghyeon2](https://velog.io/@donghyeon2) — 기술적 의사결정 과정과 트러블슈팅 경험 기록
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
- **GitHub**: [github.com/donghyeon-ka](https://github.com/donghyeon-ka)
|
||||
- **인증 서버 (메인)**: [project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
- **인프라**: [project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
- **쿼리 튜닝**: [feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
@@ -0,0 +1,89 @@
|
||||
# 강동현 · 백엔드 신입 (Platform / DevOps 친화)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Email | donghyeonka68@gmail.com |
|
||||
| GitHub | [github.com/donghyeon-ka](https://github.com/donghyeon-ka) |
|
||||
| Blog | [velog.io/@donghyeon2](https://velog.io/@donghyeon2) |
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Spring Boot 애플리케이션이 실제로 실행되는 환경까지 이해하려고, K3s 기반 로컬 / dev 플랫폼을 직접 구성해 온 신입 백엔드 개발자입니다.
|
||||
|
||||
Ingress 인증 게이트, Vault 기반 secret 주입, default-deny NetworkPolicy, PSS Restricted baseline을 함께 구성하며 애플리케이션 코드 밖의 책임을 명확히 나누는 데 집중했습니다. 백엔드는 JWT 검증과 도메인 처리에 집중하고, 로그인 / 세션 / secret / 네트워크 경계는 플랫폼 계층에서 다루도록 설계했습니다.
|
||||
|
||||
아래 내용은 운영 경험이 아니라 로컬 / dev 환경에서 실행 구조를 검증한 결과입니다. 대신 각 결정이 어떤 책임을 분리하기 위한 것인지 드러나도록 정리했습니다.
|
||||
|
||||
---
|
||||
|
||||
## Skills
|
||||
|
||||
**Core**
|
||||
- Kubernetes (K3s 1.30), Kustomize, Traefik, NetworkPolicy default-deny, PSS Restricted
|
||||
|
||||
**Secrets / Auth Gateway**
|
||||
- HashiCorp Vault 1.17.2, Vault Secrets Operator, Keycloak, oauth2-proxy, Traefik ForwardAuth, HelmChartConfig
|
||||
|
||||
**Validation / Backend**
|
||||
- `kustomize build`, `kubeconform -strict`, `kube-linter`, Java 21, Spring Boot 4, Spring Security Resource Server, PostgreSQL, Flyway
|
||||
|
||||
---
|
||||
|
||||
## Projects
|
||||
|
||||
### Project-Infra — Kubernetes 기반 백엔드 실행 환경
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
|
||||
Spring Boot 인증 서버가 동작하는 K3s 환경을 구성하고, 인증 게이트 / secret 주입 / 네트워크 정책 / manifest 검증 책임을 분리한 프로젝트입니다.
|
||||
|
||||
- Traefik ForwardAuth + oauth2-proxy + Keycloak 조합으로 미인증 요청을 Ingress 계층에서 먼저 차단하도록 구성했습니다.
|
||||
- auth-server는 Ingress 뒤에서 Keycloak JWT를 Resource Server로 다시 검증하게 하여, 로그인 세션 처리와 API 권한 검증을 분리했습니다.
|
||||
- Vault KV-v2 값을 VSO가 Kubernetes Secret으로 동기화하도록 구성하고, 도메인별 Vault role / policy를 나눠 secret 접근 범위를 제한했습니다.
|
||||
- default-deny NetworkPolicy를 기본값으로 두고, 필요한 컴포넌트 간 통신만 명시적으로 허용했습니다.
|
||||
- K3s packaged Traefik manifest를 직접 수정하지 않고 `HelmChartConfig` overlay로 설정을 관리해, 재부팅 시 설정이 사라지는 문제를 피했습니다.
|
||||
- PSS Restricted baseline을 유지하기 위해 Vault의 `disable_mlock` 설정을 선택했고, 그에 따른 swap-off 운영 전제를 명시했습니다.
|
||||
- 주요 overlay에 대해 `kustomize build`, `kubeconform -strict`, `kube-linter` 검증을 실행하는 스크립트를 구성했습니다.
|
||||
- MinIO Operator 설치, namespace / PSS 라벨 적용, Vault init / unseal, VSO 설치 흐름을 반복 실행 가능한 bootstrap script로 분리했습니다.
|
||||
|
||||
`Kubernetes` `K3s` `Kustomize` `Traefik` `oauth2-proxy` `Keycloak` `Vault` `VSO` `NetworkPolicy` `PSS`
|
||||
|
||||
### Project-Auth-Server — 플랫폼 뒤에서 동작하는 Spring Boot 백엔드
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
|
||||
플랫폼 계층이 로그인 / 세션을 처리하고, 백엔드는 Resource Server로 JWT를 검증하는 구조의 Spring Boot 인증 서버입니다.
|
||||
|
||||
- `oauth2-client`가 아니라 `oauth2-resource-server`를 사용해 백엔드 책임을 JWT 검증과 권한 매핑으로 좁혔습니다.
|
||||
- Clean / Hexagonal 5 개 모듈 구조와 ArchUnit 테스트로 계층 의존성 위반을 빌드 단계에서 탐지하도록 했습니다.
|
||||
- application 코드가 HTTP status 같은 web 프로토콜 세부사항을 직접 알지 않도록 `ErrorCode`와 HTTP status 매핑을 분리했습니다.
|
||||
- K8s 환경에서는 공식 `flyway/flyway` 이미지를 initContainer로 실행해, 자체 migration 이미지 빌드 사이클을 줄였습니다.
|
||||
|
||||
`Java 21` `Spring Boot` `Spring Security` `Keycloak` `JPA` `Flyway` `ArchUnit`
|
||||
|
||||
### feed-postgresql-query-tuning — PostgreSQL 성능 검증
|
||||
|
||||
> 개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증
|
||||
> [github.com/donghyeon-ka/feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
|
||||
플랫폼 관점에서도 애플리케이션 병목을 관찰할 수 있도록, DB 쿼리 실행 계획과 부하 테스트를 함께 정리한 프로젝트입니다.
|
||||
|
||||
- `EXPLAIN ANALYZE` 기준 피드 목록 조회 쿼리 실행 시간을 **1.77 s → 7.66 ms**로 개선했습니다.
|
||||
- JOIN 구조 변경, 페이지네이션 쿼리 분리, 복합 / 커버링 인덱스 적용을 단계적으로 검증했습니다.
|
||||
- 단일 인스턴스 Locust 1,000 동시 사용자 시나리오에서 약 **900~1,100 RPS** 구간을 확인했습니다.
|
||||
|
||||
`PostgreSQL` `EXPLAIN ANALYZE` `Index design` `Redis` `Locust`
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
- **GitHub**: [github.com/donghyeon-ka](https://github.com/donghyeon-ka)
|
||||
- **메인 프로젝트**: [project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
- **인증 서버**: [project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
- **쿼리 튜닝**: [feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
- **Blog**: [velog.io/@donghyeon2](https://velog.io/@donghyeon2)
|
||||
@@ -0,0 +1,96 @@
|
||||
# 강동현 · 백엔드 신입 (플랫폼 / DevOps 친화)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Email | donghyeonka68@gmail.com |
|
||||
| GitHub | [github.com/donghyeon-ka](https://github.com/donghyeon-ka) |
|
||||
| Velog | [velog.io/@donghyeon2](https://velog.io/@donghyeon2) |
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Spring Boot 인증 서버가 동작하는 Kubernetes 실행 환경 전체를 Kustomize 로 직접 구성해 온 신입 백엔드 개발자입니다.
|
||||
|
||||
Ingress 단 (Traefik ForwardAuth + oauth2-proxy + Keycloak) 으로 인증 게이트를 분리하고, 시크릿은 Vault → VSO → K8s Secret 자동 동기화 파이프라인으로 분리했으며, default-deny NetworkPolicy 와 PSS Restricted 를 클러스터 baseline 으로 두었습니다.
|
||||
|
||||
프로젝트 범위는 로컬 / dev 환경 기준이며, 실제 운영 경험이 아닌 실행 구조 검증과 문서화에 초점을 두었습니다.
|
||||
|
||||
---
|
||||
|
||||
## Skills
|
||||
|
||||
**Main**
|
||||
- Kubernetes (K3s 1.30), Kustomize (base / components / overlays), Traefik, NetworkPolicy default-deny, PSS Restricted enforce
|
||||
|
||||
**Used in Projects**
|
||||
- HashiCorp Vault 1.17.2, Vault Secrets Operator (VaultStaticSecret / VaultAuth / VaultConnection), Keycloak, oauth2-proxy, Helm (HelmChartConfig), Middleware (security-headers / TLSOption)
|
||||
|
||||
**Manifest / 검증**
|
||||
- Kustomize overlay 분리, `kustomize build` / `kubeconform -strict` / `kube-linter` 3 단 검증 스크립트, idempotent shell script 부트스트랩
|
||||
|
||||
**Backend (보조)**
|
||||
- Java 21, Spring Boot 4, Spring Security Resource Server, JPA, PostgreSQL, Flyway
|
||||
|
||||
---
|
||||
|
||||
## Projects
|
||||
|
||||
### Project-Infra — Kubernetes 기반 백엔드 실행 환경 구성
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
|
||||
Spring Boot 인증 서버가 동작하는 Kubernetes 실행 환경 전체를 Kustomize 로 구성하고, Ingress 인증 게이트 / Vault 시크릿 파이프라인 / NetworkPolicy 베이스라인을 함께 설계한 프로젝트입니다.
|
||||
|
||||
- **Ingress 단 인증 차단 구조** — Traefik ForwardAuth + oauth2-proxy + Keycloak 조합으로 미인증 요청을 게이트에서 차단하는 구조를 구성. 백엔드 (auth-server) 는 그 뒤에서 Keycloak JWT 를 Resource Server 로 다시 검증하는 *이중 경계* 로 분리
|
||||
- **Vault + VSO 시크릿 파이프라인** — Vault KV-v2 값을 K8s Secret 으로 자동 동기화. 도메인별 Vault role / policy 를 분리 (`vso-auth-platform` / `vso-storage`) 해 auth-platform 권한으로 storage secret 경로에 접근하지 못하도록 제한
|
||||
- **default-deny NetworkPolicy 베이스라인** — 단일 namespace 안에서도 모든 Pod 간 트래픽을 기본 차단 후 컴포넌트별 명시 허용. `namespaceSelector` + `podSelector` 를 한 블록에 묶어 AND 시맨틱 작성
|
||||
- **K3s packaged Traefik 무수정 정책** — K3s 가 재부팅 시 덮어쓰는 packaged manifest 에 손대지 않고 `HelmChartConfig` overlay 로만 운영 설정 관리 → 정책이 Git 에서 사라지지 않음
|
||||
- **PSS Restricted enforce + Vault `disable_mlock` 트레이드오프** — 클러스터 baseline 을 깎지 않기 위해 Vault 한 컴포넌트에서 트레이드오프 (대신 swap-off 노드 운영 명시)
|
||||
- **3 단 검증 스크립트 구성** — `validate.sh` 가 주요 overlay 에 대해 `kustomize build` / `kubeconform -strict` / `kube-linter` 검증을 수행하도록 구성
|
||||
- **부트스트랩 스크립트 구성** — MinIO Operator 설치, namespace / PSS 라벨 적용, Vault init · unseal, VSO Helm 설치, CRD 적용 흐름을 idempotent shell script 로 분리
|
||||
|
||||
`Kubernetes (K3s)` `Kustomize` `Traefik` `oauth2-proxy` `Keycloak` `Vault` `VSO` `NetworkPolicy` `PSS`
|
||||
|
||||
### Project-Auth-Server — 인프라가 보호하는 백엔드 (Spring Boot)
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
|
||||
Ingress 단의 oauth2-proxy + Keycloak 이 로그인 / 세션을 처리하고, 백엔드는 Resource Server 로서 JWT 를 다시 검증하는 구조의 Spring Boot 인증 서버입니다.
|
||||
|
||||
- **Resource Server 단순화** — `oauth2-client` 가 아니라 `oauth2-resource-server` 만 사용. 로그인 플로우는 인프라가 처리하고 백엔드는 JWT 검증과 권한 매핑에 집중
|
||||
- **Clean / Hexagonal 5 모듈 + ArchUnit** — 레이어 의존성 위반을 빌드 단계에서 자동 차단. CI 연결 시 PR 게이트 활용 가능
|
||||
- **`ErrorCode` 와 HTTP status 분리** — application 코드가 web 프로토콜에 누설되지 않도록 분리
|
||||
- **Flyway V1~V5 마이그레이션** — K8s 에서는 공식 `flyway/flyway` 이미지를 initContainer 로 실행 (자체 migration 이미지 빌드 사이클 제거)
|
||||
|
||||
`Java 21` `Spring Boot 4` `Spring Security` `Keycloak` `JPA` `Flyway`
|
||||
|
||||
### feed-postgresql-query-tuning — PostgreSQL 쿼리 튜닝 프로젝트
|
||||
|
||||
> 개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증
|
||||
> [github.com/donghyeon-ka/feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
|
||||
피드 목록 조회 쿼리를 EXPLAIN ANALYZE 기준으로 분석해 응답 시간을 단계적으로 개선한 프로젝트입니다.
|
||||
|
||||
- 피드 목록 조회 쿼리 응답 시간 **1.77 초 → 7.66 ms** 단축 (EXPLAIN ANALYZE 기준 쿼리 실행 시간)
|
||||
- 4-table LEFT JOIN 분석 → EXISTS 서브쿼리 + 쿼리 분리 → 복합/커버링 인덱스 단계적 적용
|
||||
- 단일 인스턴스 환경 Locust 부하 검증 (1,000 동시 사용자 → 900~1,100 RPS)
|
||||
|
||||
`PostgreSQL` `JPA` `EXPLAIN ANALYZE` `Index design` `Redis` `Locust`
|
||||
|
||||
---
|
||||
|
||||
## Blog
|
||||
|
||||
- [Velog @donghyeon2](https://velog.io/@donghyeon2) — 기술적 의사결정 과정과 트러블슈팅 경험 기록
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
- **GitHub**: [github.com/donghyeon-ka](https://github.com/donghyeon-ka)
|
||||
- **인프라 (메인)**: [project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
- **인증 서버**: [project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
- **쿼리 튜닝**: [feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
@@ -0,0 +1,88 @@
|
||||
# 강동현 · 백엔드 신입 (성능 / DB)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Email | donghyeonka68@gmail.com |
|
||||
| GitHub | [github.com/donghyeon-ka](https://github.com/donghyeon-ka) |
|
||||
| Blog | [velog.io/@donghyeon2](https://velog.io/@donghyeon2) |
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
DB 기반 백엔드 시스템에서 쿼리 실행 계획, 인덱스 설계, 애플리케이션과 인프라의 책임 경계에 관심을 두고 학습해 온 신입 백엔드 개발자입니다.
|
||||
|
||||
PostgreSQL 피드 조회 튜닝 프로젝트에서 `EXPLAIN ANALYZE`로 병목을 확인하고, JOIN 구조 / 페이지네이션 흐름 / 인덱스 설계를 바꿔 쿼리 실행 시간을 **1.77 s → 7.66 ms**로 줄였습니다. 이후 Redis 캐시와 Locust 부하 테스트로 개선 경로를 검증했습니다.
|
||||
|
||||
아래 성능 수치는 모두 로컬 실험 또는 단일 인스턴스 부하 테스트 기준입니다. 운영 경험처럼 과장하지 않기 위해 측정 범위를 명시했습니다.
|
||||
|
||||
---
|
||||
|
||||
## Skills
|
||||
|
||||
**Core**
|
||||
- Java 21, Spring Boot 4, Spring Data JPA, PostgreSQL 16, Redis
|
||||
|
||||
**Database / Performance**
|
||||
- `EXPLAIN ANALYZE`, 복합 인덱스, 커버링 인덱스, 페이지네이션 쿼리 설계, N+1 회피, p50 / p95 / p99 latency 측정
|
||||
|
||||
**Supporting**
|
||||
- Flyway, ArchUnit, Locust, Kubernetes (K3s), Kustomize, Traefik, Vault
|
||||
|
||||
---
|
||||
|
||||
## Projects
|
||||
|
||||
### feed-postgresql-query-tuning — PostgreSQL 쿼리 최적화
|
||||
|
||||
> 개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 구현 / 검증
|
||||
> [github.com/donghyeon-ka/feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
|
||||
피드 목록 조회 쿼리를 실행 계획 기준으로 분석하고, 실제 접근 패턴에 맞춰 쿼리 책임과 인덱스 구조를 다시 설계한 프로젝트입니다.
|
||||
|
||||
- `EXPLAIN ANALYZE` 기준 피드 목록 조회 쿼리 실행 시간을 **1.77 s → 7.66 ms**로 개선했습니다.
|
||||
- 주요 병목으로 4-table `LEFT JOIN`에 따른 row 폭증, 사용 가능한 인덱스 부재로 인한 sequential scan, 디스크 기반 외부 정렬(`Sort Method: external merge Disk`)을 확인했습니다.
|
||||
- 불필요한 `LEFT JOIN`을 `EXISTS` 서브쿼리로 바꾸고, 페이지네이션과 상세 로딩 책임을 분리해 실행 시간을 **1.77 s → 0.216 s**로 줄였습니다.
|
||||
- WHERE 조건과 정렬 키를 함께 고려한 복합 인덱스, 자주 조회되는 컬럼을 포함한 커버링 인덱스를 적용해 **0.216 s → 7.66 ms**까지 줄였습니다.
|
||||
- 공개 피드에는 Redis 2 단계 캐시를 적용하고 private 피드는 캐시를 우회하도록 분리했습니다. 테스트 구간에서 약 **90% cache hit rate**를 관찰했습니다.
|
||||
- 단일 인스턴스 환경에서 Locust 1,000 동시 사용자 시나리오를 실행해 약 **900~1,100 RPS** 구간을 확인했습니다.
|
||||
- JPA 측면에서는 N+1을 피하고, 기본 LAZY 로딩과 필요한 지점의 명시적 fetch join을 분리했으며, `Page` 응답의 count 쿼리를 별도로 다뤘습니다.
|
||||
|
||||
`PostgreSQL` `EXPLAIN ANALYZE` `Index design` `JPA` `Redis` `Locust` `Spring Boot`
|
||||
|
||||
### Project-Auth-Server — Spring Boot 인증 서버의 DB 책임 경계
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
|
||||
Spring Boot 인증 서버에서 도메인 규칙, 영속성 매핑, 트랜잭션 소유권을 분리해 구현한 프로젝트입니다.
|
||||
|
||||
- Flyway V1~V5로 PostgreSQL 스키마 변경을 관리하고, `auth` 스키마 생성 / 사용자 도메인 테이블 / Keycloak provider 컬럼 추가를 단계별로 분리했습니다.
|
||||
- 트랜잭션 소유권을 application use case로 이동시켜 infrastructure adapter가 비즈니스 트랜잭션 범위를 결정하지 않도록 정리했습니다.
|
||||
- 저장된 row를 도메인 객체로 복원하는 과정에서 잘못된 데이터가 발견되면 일반 도메인 검증 실패가 아니라 인프라 무결성 문제로 번역했습니다.
|
||||
- DB row와 `UserEmail`, `UserName`, `User` 같은 도메인 값 객체를 분리해 JPA entity 관심사 밖에서 invariant를 검증했습니다.
|
||||
|
||||
`Java 21` `Spring Boot` `PostgreSQL` `JPA` `Flyway` `ArchUnit`
|
||||
|
||||
### Project-Infra — 저장소와 배포 책임 분리
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 로컬 / dev 환경 구성
|
||||
> [github.com/donghyeon-ka/project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
|
||||
auth-server 실행 환경을 K3s 위에 구성하면서 데이터 저장소와 배포 단계의 책임을 분리한 프로젝트입니다.
|
||||
|
||||
- 애플리케이션 row 데이터는 PostgreSQL, object storage는 MinIO, Docker Registry 저장소는 MinIO S3 backend로 분리했습니다.
|
||||
- Flyway 마이그레이션 실행을 애플리케이션 시작과 분리해, 스키마 변경이 앱 배포보다 먼저 실행될 수 있도록 구성했습니다.
|
||||
- 외부 image push 인증은 Traefik BasicAuth, 내부 image pull은 Kubernetes `imagePullSecret`으로 나눠 인증 경계를 분리했습니다.
|
||||
|
||||
`Kubernetes` `K3s` `PostgreSQL` `MinIO` `Docker Registry` `Flyway` `Kustomize`
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
- **GitHub**: [github.com/donghyeon-ka](https://github.com/donghyeon-ka)
|
||||
- **메인 프로젝트**: [feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
- **인증 서버**: [project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
- **인프라**: [project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
- **Blog**: [velog.io/@donghyeon2](https://velog.io/@donghyeon2)
|
||||
@@ -0,0 +1,94 @@
|
||||
# 강동현 · 백엔드 신입 (성능 / DB)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Email | donghyeonka68@gmail.com |
|
||||
| GitHub | [github.com/donghyeon-ka](https://github.com/donghyeon-ka) |
|
||||
| Velog | [velog.io/@donghyeon2](https://velog.io/@donghyeon2) |
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
PostgreSQL 쿼리 분석과 인덱스 설계에 관심을 두고, 피드 목록 조회 쿼리를 EXPLAIN ANALYZE 기준으로 분석해 1.77 초 → 7.66 ms 까지 단계적으로 개선한 경험이 있는 신입 백엔드 개발자입니다.
|
||||
|
||||
Redis 2 단계 캐시와 Locust 부하 테스트로 검증 흐름을 정리했고, JPA fetch 전략 / Flyway 마이그레이션 / 트랜잭션 위치 등 데이터 레이어 책임 경계도 함께 정리했습니다.
|
||||
|
||||
모든 성능 수치는 로컬 실험 및 단일 인스턴스 부하 테스트 기준으로 정리했습니다.
|
||||
|
||||
---
|
||||
|
||||
## Skills
|
||||
|
||||
**Main**
|
||||
- PostgreSQL 16, EXPLAIN ANALYZE, 복합 / 커버링 인덱스 설계, Redis, Locust
|
||||
|
||||
**Used in Projects**
|
||||
- Spring Data JPA (fetch 전략, N+1 회피), Flyway (V1~V5), 외부 정렬 / Bitmap Heap Scan / Hash Join 분석, p50 / p95 / p99 latency 측정
|
||||
|
||||
**Backend (보조)**
|
||||
- Java 21, Spring Boot 4, Spring Security Resource Server, ArchUnit
|
||||
|
||||
---
|
||||
|
||||
## Projects
|
||||
|
||||
### feed-postgresql-query-tuning — PostgreSQL 쿼리 튜닝
|
||||
|
||||
> 개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증
|
||||
> 모든 수치는 EXPLAIN ANALYZE 기준 쿼리 실행 시간
|
||||
> [github.com/donghyeon-ka/feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
|
||||
피드 목록 조회 쿼리를 EXPLAIN ANALYZE 기준으로 분석하고, JOIN 구조 / 인덱스 설계 / 캐시 전략 / 부하 검증 순으로 단계적으로 개선한 프로젝트입니다.
|
||||
|
||||
- 피드 목록 조회 쿼리 응답 시간 **1.77 초 → 7.66 ms** 까지 단계적으로 개선
|
||||
- **원인 분석** (EXPLAIN ANALYZE) — 4-table LEFT JOIN 으로 인한 데이터 폭증, 인덱스 미사용으로 인한 sequential scan, 디스크 기반 외부 정렬 (`Sort Method: external merge Disk`) 발생 확인
|
||||
- **1 차 개선** — 불필요한 LEFT JOIN 을 `EXISTS` 서브쿼리로 교체 + 페이지네이션 쿼리 분리 → **1.77 초 → 0.216 초** (8 배)
|
||||
- **2 차 개선** — 정렬 키 + WHERE 절 컬럼을 합친 복합 인덱스 + 자주 SELECT 되는 컬럼 포함 커버링 인덱스 → **0.216 초 → 7.66 ms** (28 배). 인덱스 기반 조회로 디스크 접근과 정렬 비용을 줄임
|
||||
- **캐시 전략** — Redis 2 단계 캐시 (공개 피드만 캐시, private 피드는 우회) 도입. 부하 테스트 구간에서 캐시 히트율 약 **90%** 관찰
|
||||
- **부하 검증** — 단일 인스턴스 환경에서 Locust 로 동시 1,000 명 시나리오 → **900~1,100 RPS** (구간별 latency p50 / p95 / p99 측정)
|
||||
- **JPA 측면** — N+1 회피, fetch 전략 명시 (LAZY + 필요 시 명시적 join fetch), Spring Data Page 의 count 쿼리 분리
|
||||
|
||||
`PostgreSQL` `JPA` `EXPLAIN ANALYZE` `Index design` `Redis` `Locust` `Spring Boot`
|
||||
|
||||
### Project-Auth-Server — Spring Boot 인증 서버 (DB 측면)
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증
|
||||
> [github.com/donghyeon-ka/project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
|
||||
Spring Boot 인증 서버 프로젝트 — 본 트랙에서는 PostgreSQL 스키마 / JPA / Flyway / 트랜잭션 경계 등 데이터 레이어 관련 결정 중심으로 정리합니다.
|
||||
|
||||
- **Flyway V1~V5 단계적 마이그레이션** — `auth` 스키마, 사용자 도메인 + Keycloak provider 통합 컬럼 (`provider`, `provider_subject`, `KEYCLOAK` 단일 값으로 고정) 까지 5 단계로 분리
|
||||
- **트랜잭션 경계는 application use case 가 소유** — `infrastructure` adapter 가 `@Transactional` 을 들고 있던 구조를 ADR 로 정리해 application 레이어로 이동
|
||||
- **infrastructure → domain 복원 시 무결성 보호** — `JpaUserRepositoryAdapter` 가 row → User 복원 중 `DomainException` 등이 발생하면 `InfrastructureException(PERSISTED_DATA_INVALID)` 로 번역 (잘못된 저장 데이터를 비즈니스 검증 실패가 아니라 인프라 무결성 문제로 분류)
|
||||
- **DB row 와 도메인 값 객체 분리** — `User`, `UserEmail`, `UserName` 등 VO 의 invariant 가 entity 와 별도로 검증
|
||||
|
||||
`PostgreSQL` `JPA` `Flyway` `Spring Boot` `ArchUnit`
|
||||
|
||||
### Project-Infra — 데이터 저장소와 책임 분리
|
||||
|
||||
> 개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 로컬 / dev 환경 구성
|
||||
> [github.com/donghyeon-ka/project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
|
||||
auth-server 가 동작하는 K3s 환경에서 데이터 저장소 (PostgreSQL / MinIO / Docker Registry) 책임을 분리해 구성한 프로젝트입니다.
|
||||
|
||||
- **Postgres + MinIO + Docker Registry 책임 분리** — 애플리케이션 row 데이터는 PostgreSQL, object storage 는 MinIO, Docker Registry 는 자체 PV 없이 MinIO S3 backend 위임
|
||||
- Flyway 마이그레이션 Job 을 앱보다 먼저 실행되도록 분리하고, GitOps 적용 시 PreSync / sync-wave 로 배포 순서를 제어할 수 있게 구성
|
||||
- 외부 push 인증은 Traefik Middleware BasicAuth, 내부 pull 은 K8s imagePullSecret 으로 책임 경계 분리
|
||||
|
||||
`PostgreSQL` `MinIO` `Docker Registry` `Flyway` `Kustomize`
|
||||
|
||||
---
|
||||
|
||||
## Blog
|
||||
|
||||
- [Velog @donghyeon2](https://velog.io/@donghyeon2) — 기술적 의사결정 과정과 트러블슈팅 경험 기록
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
- **GitHub**: [github.com/donghyeon-ka](https://github.com/donghyeon-ka)
|
||||
- **쿼리 튜닝 (메인)**: [feed-postgresql-query-tuning](https://github.com/donghyeon-ka/feed-postgresql-query-tuning)
|
||||
- **인증 서버**: [project-auth-server](https://github.com/donghyeon-ka/project-auth-server)
|
||||
- **인프라**: [project-infra](https://github.com/donghyeon-ka/project-infra)
|
||||
@@ -0,0 +1,58 @@
|
||||
# Resume
|
||||
|
||||
직무 트랙별 이력서 모음. 모든 변형은 같은 사실 기반(같은 프로젝트 / 같은 수치 / 같은 기간) 에서 *강조점만* 다르게 정리됨.
|
||||
|
||||
| 파일 | 대상 공고 | 강조 |
|
||||
|---|---|---|
|
||||
| [01-java-spring-backend.md](./01-java-spring-backend.md) | Java / Spring 백엔드 | Spring Boot · Spring Security · JPA · PostgreSQL · API · 테스트 |
|
||||
| [02-platform-devops-backend.md](./02-platform-devops-backend.md) | 플랫폼 / DevOps 친화 백엔드 | Kubernetes · Keycloak · Vault · Traefik · NetworkPolicy · GitOps |
|
||||
| [03-performance-db.md](./03-performance-db.md) | 성능 / DB 관심 | PostgreSQL · EXPLAIN ANALYZE · Index · Redis · Locust |
|
||||
|
||||
## 작성 원칙
|
||||
|
||||
- 2 페이지 이내 (PDF 출력 기준)
|
||||
- 구조: Summary / Skills / Projects / Blog / Links
|
||||
- 프로젝트 bullet 5~7 개 이내
|
||||
- 모든 수치는 측정 환경 명시 (로컬 / dev / EXPLAIN ANALYZE 기준)
|
||||
- 운영 경험처럼 표현 금지 — 개인 프로젝트 / 학습 프로젝트 / 로컬 / dev 명시
|
||||
- 채용자가 읽었을 때 자연스럽게 면접 질문이 나오도록 *결정 narrative + 수치* 배치
|
||||
|
||||
---
|
||||
|
||||
## 트랙별 보강 후보 (이력서에 적지 않음, 시간 여유 시 작업)
|
||||
|
||||
이력서 본문은 *현재 실제로 한 작업* 만 반영. 아래는 *시니어 시각의 약점 / 다음 라운드에 채우면 좋을 항목* 정리. 작업 후 이력서에 반영하는 흐름으로 운영.
|
||||
|
||||
### 공통 (3 트랙 모두)
|
||||
- **JaCoCo 커버리지 측정** — `application` / `presentation` / `infrastructure` 모듈별 % 측정 후 Skills 또는 Project bullet 에 한 줄 추가. 면접에서 *"테스트 얼마나?"* 답 강화.
|
||||
- **GitHub Actions CI workflow** — 각 repo 에 `.github/workflows/ci.yml` (build + test + validate.sh) 추가 + README 상단 녹색 배지. *"체계적으로 검증한다"* 시그널.
|
||||
- **Spring Boot 4.0 변경점 면접 답 준비** — JDK 21 baseline / Servlet 6 / Spring Framework 7 / observability autoconfig 분리 등 핵심 변경점 메모. (이력서 본문은 그대로, 면접 노트로만)
|
||||
|
||||
### 트랙 1 (Java / Spring) — 약점 보강
|
||||
|
||||
- **Project-Auth-Server 의 다른 측면** 을 3 번째 프로젝트로 추가하면 트랙 일관성 ↑ — 후보:
|
||||
- OpenAPI annotation 분리 패턴 (Controller / *ApiDocs* interface 분리)
|
||||
- `@Transactional` 위치 ADR (infrastructure adapter → application use case 로 이동)
|
||||
- `ApiResult<T>` testable factory 패턴
|
||||
- 트랙 1 에서 Project-Infra 는 *"백엔드가 동작하는 환경에 대한 이해"* 한 줄로 압축하거나 제거하는 게 트랙 집중도 ↑
|
||||
|
||||
### 트랙 2 (플랫폼 / DevOps) — 약점 보강
|
||||
|
||||
- **GitHub Actions CI 가 PR 게이트로 동작하는 결과물** — workflow 추가 후 *"PR 게이트"* 표현을 본문에 다시 사용 가능 (현재는 *"CI 연결 시"* 가능 형태로 약화)
|
||||
- **cert-manager 정식 인증서 발급 + ssl_insecure_skip_verify 제거** — Project-Infra Limitations 의 핵심 미완 항목. 완료 시 *"E2E 인증 흐름 검증 완료"* 로 표현 강화 가능
|
||||
- **실제 ArgoCD 배포 (annotation 만 있는 현 상태 → 실제 sync)** — 또는 본문에서 *"(annotation 적용, 실제 ArgoCD 미배포)"* 한 줄 명확화
|
||||
- **Skills 에 *"GitOps source-of-truth 관리"* 키워드 명시** — ATS 검색 매칭 강화 (공고 키워드가 *"GitOps"* 일 때)
|
||||
|
||||
### 트랙 3 (성능 / DB) — 약점 보강 (가장 우선순위 높음)
|
||||
|
||||
- **추가 분석 사례 1~2 건 더** — 같은 EXPLAIN ANALYZE 패턴을 *다른 시나리오* (예: auth-server 의 user 조회 / Keycloak claim 매핑 / 페이지네이션 쿼리) 에 적용한 경험. 1 개월 단일 학습 프로젝트 의존을 깨는 가장 효과적인 patch.
|
||||
- **측정 환경 구체화** — 현재 *"단일 인스턴스 환경"* → *"노트북 (Mac M1 / 16 GB / Postgres 16 docker container)"* 또는 사용한 실제 사양 명시. RPS 의미가 환경 따라 크게 달라짐.
|
||||
- **캐시 히트율 측정 방법** — `redis-cli INFO stats` 의 `keyspace_hits` / `keyspace_misses` 비율, 워밍업 후 N 분 간 측정 같은 구체성. 현재는 결과 수치만 있음.
|
||||
- **JaCoCo 또는 별도 쿼리 회귀 테스트** — 인덱스 추가 / 쿼리 변경 시 회귀를 잡는 테스트 추가. 면접 *"이 인덱스가 다른 쿼리를 느리게 만들지 않는다는 걸 어떻게 보장?"* 답 준비.
|
||||
|
||||
### 적용 흐름
|
||||
|
||||
1. 위 항목 중 1 개씩 실제 작업 수행
|
||||
2. 작업 결과를 해당 repo README 에 먼저 기록
|
||||
3. 결과가 *측정 가능* 한 형태가 되면 이력서 본문에 한 줄 반영
|
||||
4. 본 README 의 해당 항목 ✅ 표시 또는 삭제
|
||||
@@ -0,0 +1,206 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>01-java-spring-backend.feat.google-version</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>강동현 · 백엔드 신입 (Java / Spring)</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>Blog</td><td><a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></td></tr></tbody></table>
|
||||
<hr>
|
||||
<h2>Summary</h2>
|
||||
<p>Java / Spring Boot 기반 백엔드에서 인증, 계층 분리, 예외 응답 표준화, 데이터 영속성 경계에 집중해 학습해 온 신입 백엔드 개발자입니다.</p>
|
||||
<p>Spring Boot 인증 서버를 5 개 모듈 Clean / Hexagonal 구조로 나누고, <code>domain</code> 모듈이 Spring / JPA / Servlet에 의존하지 않도록 분리했습니다. 또한 ArchUnit 테스트로 계층 의존성을 검증하고, Keycloak JWT를 Resource Server로 다시 검증하는 구조를 구현했습니다.</p>
|
||||
<p>프로젝트는 개인 로컬 / dev 환경 기준입니다. 대신 구현 범위, 검증 범위, 아직 운영 경험으로 볼 수 없는 부분을 문서 안에서 구분했습니다.</p>
|
||||
<hr>
|
||||
<h2>Skills</h2>
|
||||
<p><strong>Core</strong></p>
|
||||
<ul><li>Java 21, Spring Boot 4, Spring Security Resource Server, Spring Data JPA, PostgreSQL 16</li></ul>
|
||||
<p><strong>Architecture / Testing</strong></p>
|
||||
<ul><li>Clean Architecture, Hexagonal Architecture, Gradle multi-project, ArchUnit, JUnit 5, AssertJ</li></ul>
|
||||
<p><strong>Auth / Observability</strong></p>
|
||||
<ul><li>Keycloak, OAuth2 / OIDC, JWKS 기반 JWT 검증, Flyway, OpenAPI / Swagger UI, MDC <code>traceId</code> 기반 structured logging</li></ul>
|
||||
<hr>
|
||||
<h2>Projects</h2>
|
||||
<section class="project"><h3>Project-Auth-Server — Spring Boot 인증 서버</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 인증 서버를 계층별 책임이 드러나도록 분리하고, 인증 위임 / JWT 검증 / 예외 응답 / DB 마이그레이션 경계를 정리한 프로젝트입니다.</p><ul><li>Gradle multi-project로 <code>domain</code> / <code>application</code> / <code>presentation</code> / <code>infrastructure</code> / <code>bootstrap</code> 5 개 모듈을 분리했습니다.</li><li><code>domain</code> 모듈은 Spring, JPA, Servlet 의존성을 두지 않고 값 객체와 도메인 규칙만 포함하도록 구성했습니다.</li><li>ArchUnit의 <code>LayerDependencyArchitectureTest</code>로 <code>presentation → infrastructure</code> 같은 계층 위반을 빌드 단계에서 탐지하도록 했습니다.</li><li>로그인 플로우는 Keycloak / Ingress 계층에 위임하고, 백엔드는 <code>oauth2-resource-server</code>로 JWT issuer / signature / expiration / role claim을 다시 검증하도록 구성했습니다.</li><li><code>ErrorCode</code>는 비즈니스 의미만 담고, HTTP status 매핑은 presentation의 mapper가 담당하도록 분리했습니다.</li><li>예외 처리는 Security filter, Spring MVC 입력 검증, application, infrastructure 누수 감지로 나눴고, 응답은 <code>ApiResult<T></code> 형태로 통일했습니다.</li><li><code>TraceIdFilter</code>로 32 자리 hex <code>traceId</code>를 응답 헤더, 로그, audit 흐름에 동일하게 전파했습니다.</li><li>Flyway V1~V5로 <code>auth</code> 스키마와 사용자 / provider 관련 변경을 단계별 마이그레이션으로 관리했습니다.</li></ul><p><code>Java 21</code> <code>Spring Boot</code> <code>Spring Security</code> <code>Keycloak</code> <code>JPA</code> <code>PostgreSQL</code> <code>ArchUnit</code> <code>Flyway</code></p></section>
|
||||
<section class="project"><h3>feed-postgresql-query-tuning — PostgreSQL 쿼리 최적화</h3><blockquote><p>개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증 <a href="https://github.com/donghyeon-ka/feed-postgresql-query-tuning">github.com/donghyeon-ka/feed-postgresql-query-tuning</a></p></blockquote><p>피드 목록 조회 쿼리를 실행 계획 기준으로 분석하고, JOIN 구조와 인덱스 설계를 바꿔 성능을 개선한 프로젝트입니다.</p><ul><li><code>EXPLAIN ANALYZE</code> 기준 피드 목록 조회 쿼리 실행 시간을 <strong>1.77 s → 7.66 ms</strong>로 개선했습니다.</li><li>4-table <code>LEFT JOIN</code>에 따른 row 폭증, 인덱스 미사용, 디스크 기반 외부 정렬을 병목으로 확인했습니다.</li><li><code>EXISTS</code> 서브쿼리, 페이지네이션 쿼리 분리, 복합 / 커버링 인덱스를 단계적으로 적용했습니다.</li><li>단일 인스턴스 환경에서 Locust 1,000 동시 사용자 시나리오를 실행해 약 <strong>900~1,100 RPS</strong> 구간을 확인했습니다.</li></ul><p><code>PostgreSQL</code> <code>EXPLAIN ANALYZE</code> <code>Index design</code> <code>JPA</code> <code>Redis</code> <code>Locust</code></p></section>
|
||||
<section class="project"><h3>Project-Infra — Spring 앱 실행 환경</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가 동작하는 로컬 / dev K3s 환경을 구성하면서 백엔드와 인프라의 인증 책임을 분리한 프로젝트입니다.</p><ul><li>Traefik ForwardAuth + oauth2-proxy + Keycloak으로 로그인 / 세션 확인을 Ingress 계층에 두고, auth-server는 JWT 검증에 집중하도록 구성했습니다.</li><li>Vault → VSO → Kubernetes Secret 흐름으로 secret 주입 책임을 애플리케이션 코드 밖으로 분리했습니다.</li><li>Kustomize base / overlay 구조로 로컬과 dev 환경 차이를 manifest 단에서 관리했습니다.</li></ul><p><code>Kubernetes</code> <code>K3s</code> <code>Kustomize</code> <code>Vault</code> <code>VSO</code> <code>Traefik</code></p><hr></section>
|
||||
<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/project-auth-server">project-auth-server</a></li><li><strong>인프라</strong>: <a href="https://github.com/donghyeon-ka/project-infra">project-infra</a></li><li><strong>쿼리 튜닝</strong>: <a href="https://github.com/donghyeon-ka/feed-postgresql-query-tuning">feed-postgresql-query-tuning</a></li><li><strong>Blog</strong>: <a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></li></ul>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
@@ -0,0 +1,206 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>02-platform-devops-backend.feat.google-version</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>강동현 · 백엔드 신입 (Platform / DevOps 친화)</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>Blog</td><td><a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></td></tr></tbody></table>
|
||||
<hr>
|
||||
<h2>Summary</h2>
|
||||
<p>Spring Boot 애플리케이션이 실제로 실행되는 환경까지 이해하려고, K3s 기반 로컬 / dev 플랫폼을 직접 구성해 온 신입 백엔드 개발자입니다.</p>
|
||||
<p>Ingress 인증 게이트, Vault 기반 secret 주입, default-deny NetworkPolicy, PSS Restricted baseline을 함께 구성하며 애플리케이션 코드 밖의 책임을 명확히 나누는 데 집중했습니다. 백엔드는 JWT 검증과 도메인 처리에 집중하고, 로그인 / 세션 / secret / 네트워크 경계는 플랫폼 계층에서 다루도록 설계했습니다.</p>
|
||||
<p>아래 내용은 운영 경험이 아니라 로컬 / dev 환경에서 실행 구조를 검증한 결과입니다. 대신 각 결정이 어떤 책임을 분리하기 위한 것인지 드러나도록 정리했습니다.</p>
|
||||
<hr>
|
||||
<h2>Skills</h2>
|
||||
<p><strong>Core</strong></p>
|
||||
<ul><li>Kubernetes (K3s 1.30), Kustomize, Traefik, NetworkPolicy default-deny, PSS Restricted</li></ul>
|
||||
<p><strong>Secrets / Auth Gateway</strong></p>
|
||||
<ul><li>HashiCorp Vault 1.17.2, Vault Secrets Operator, Keycloak, oauth2-proxy, Traefik ForwardAuth, HelmChartConfig</li></ul>
|
||||
<p><strong>Validation / Backend</strong></p>
|
||||
<ul><li><code>kustomize build</code>, <code>kubeconform -strict</code>, <code>kube-linter</code>, Java 21, Spring Boot 4, Spring Security Resource Server, PostgreSQL, Flyway</li></ul>
|
||||
<hr>
|
||||
<h2>Projects</h2>
|
||||
<section class="project"><h3>Project-Infra — Kubernetes 기반 백엔드 실행 환경</h3><blockquote><p>개인 프로젝트 · 2025.11 ~ 현재 · 1 인 · 설계 / 구현 / 로컬 검증 <a href="https://github.com/donghyeon-ka/project-infra">github.com/donghyeon-ka/project-infra</a></p></blockquote><p>Spring Boot 인증 서버가 동작하는 K3s 환경을 구성하고, 인증 게이트 / secret 주입 / 네트워크 정책 / manifest 검증 책임을 분리한 프로젝트입니다.</p><ul><li>Traefik ForwardAuth + oauth2-proxy + Keycloak 조합으로 미인증 요청을 Ingress 계층에서 먼저 차단하도록 구성했습니다.</li><li>auth-server는 Ingress 뒤에서 Keycloak JWT를 Resource Server로 다시 검증하게 하여, 로그인 세션 처리와 API 권한 검증을 분리했습니다.</li><li>Vault KV-v2 값을 VSO가 Kubernetes Secret으로 동기화하도록 구성하고, 도메인별 Vault role / policy를 나눠 secret 접근 범위를 제한했습니다.</li><li>default-deny NetworkPolicy를 기본값으로 두고, 필요한 컴포넌트 간 통신만 명시적으로 허용했습니다.</li><li>K3s packaged Traefik manifest를 직접 수정하지 않고 <code>HelmChartConfig</code> overlay로 설정을 관리해, 재부팅 시 설정이 사라지는 문제를 피했습니다.</li><li>PSS Restricted baseline을 유지하기 위해 Vault의 <code>disable_mlock</code> 설정을 선택했고, 그에 따른 swap-off 운영 전제를 명시했습니다.</li><li>주요 overlay에 대해 <code>kustomize build</code>, <code>kubeconform -strict</code>, <code>kube-linter</code> 검증을 실행하는 스크립트를 구성했습니다.</li><li>MinIO Operator 설치, namespace / PSS 라벨 적용, Vault init / unseal, VSO 설치 흐름을 반복 실행 가능한 bootstrap script로 분리했습니다.</li></ul><p><code>Kubernetes</code> <code>K3s</code> <code>Kustomize</code> <code>Traefik</code> <code>oauth2-proxy</code> <code>Keycloak</code> <code>Vault</code> <code>VSO</code> <code>NetworkPolicy</code> <code>PSS</code></p></section>
|
||||
<section class="project"><h3>Project-Auth-Server — 플랫폼 뒤에서 동작하는 Spring Boot 백엔드</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>플랫폼 계층이 로그인 / 세션을 처리하고, 백엔드는 Resource Server로 JWT를 검증하는 구조의 Spring Boot 인증 서버입니다.</p><ul><li><code>oauth2-client</code>가 아니라 <code>oauth2-resource-server</code>를 사용해 백엔드 책임을 JWT 검증과 권한 매핑으로 좁혔습니다.</li><li>Clean / Hexagonal 5 개 모듈 구조와 ArchUnit 테스트로 계층 의존성 위반을 빌드 단계에서 탐지하도록 했습니다.</li><li>application 코드가 HTTP status 같은 web 프로토콜 세부사항을 직접 알지 않도록 <code>ErrorCode</code>와 HTTP status 매핑을 분리했습니다.</li><li>K8s 환경에서는 공식 <code>flyway/flyway</code> 이미지를 initContainer로 실행해, 자체 migration 이미지 빌드 사이클을 줄였습니다.</li></ul><p><code>Java 21</code> <code>Spring Boot</code> <code>Spring Security</code> <code>Keycloak</code> <code>JPA</code> <code>Flyway</code> <code>ArchUnit</code></p></section>
|
||||
<section class="project"><h3>feed-postgresql-query-tuning — PostgreSQL 성능 검증</h3><blockquote><p>개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 최적화 / 검증 <a href="https://github.com/donghyeon-ka/feed-postgresql-query-tuning">github.com/donghyeon-ka/feed-postgresql-query-tuning</a></p></blockquote><p>플랫폼 관점에서도 애플리케이션 병목을 관찰할 수 있도록, DB 쿼리 실행 계획과 부하 테스트를 함께 정리한 프로젝트입니다.</p><ul><li><code>EXPLAIN ANALYZE</code> 기준 피드 목록 조회 쿼리 실행 시간을 <strong>1.77 s → 7.66 ms</strong>로 개선했습니다.</li><li>JOIN 구조 변경, 페이지네이션 쿼리 분리, 복합 / 커버링 인덱스 적용을 단계적으로 검증했습니다.</li><li>단일 인스턴스 Locust 1,000 동시 사용자 시나리오에서 약 <strong>900~1,100 RPS</strong> 구간을 확인했습니다.</li></ul><p><code>PostgreSQL</code> <code>EXPLAIN ANALYZE</code> <code>Index design</code> <code>Redis</code> <code>Locust</code></p><hr></section>
|
||||
<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/project-infra">project-infra</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/feed-postgresql-query-tuning">feed-postgresql-query-tuning</a></li><li><strong>Blog</strong>: <a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></li></ul>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
+206
@@ -0,0 +1,206 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>03-performance-db.feat.google-version</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>Blog</td><td><a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></td></tr></tbody></table>
|
||||
<hr>
|
||||
<h2>Summary</h2>
|
||||
<p>DB 기반 백엔드 시스템에서 쿼리 실행 계획, 인덱스 설계, 애플리케이션과 인프라의 책임 경계에 관심을 두고 학습해 온 신입 백엔드 개발자입니다.</p>
|
||||
<p>PostgreSQL 피드 조회 튜닝 프로젝트에서 <code>EXPLAIN ANALYZE</code>로 병목을 확인하고, JOIN 구조 / 페이지네이션 흐름 / 인덱스 설계를 바꿔 쿼리 실행 시간을 <strong>1.77 s → 7.66 ms</strong>로 줄였습니다. 이후 Redis 캐시와 Locust 부하 테스트로 개선 경로를 검증했습니다.</p>
|
||||
<p>아래 성능 수치는 모두 로컬 실험 또는 단일 인스턴스 부하 테스트 기준입니다. 운영 경험처럼 과장하지 않기 위해 측정 범위를 명시했습니다.</p>
|
||||
<hr>
|
||||
<h2>Skills</h2>
|
||||
<p><strong>Core</strong></p>
|
||||
<ul><li>Java 21, Spring Boot 4, Spring Data JPA, PostgreSQL 16, Redis</li></ul>
|
||||
<p><strong>Database / Performance</strong></p>
|
||||
<ul><li><code>EXPLAIN ANALYZE</code>, 복합 인덱스, 커버링 인덱스, 페이지네이션 쿼리 설계, N+1 회피, p50 / p95 / p99 latency 측정</li></ul>
|
||||
<p><strong>Supporting</strong></p>
|
||||
<ul><li>Flyway, ArchUnit, Locust, Kubernetes (K3s), Kustomize, Traefik, Vault</li></ul>
|
||||
<hr>
|
||||
<h2>Projects</h2>
|
||||
<section class="project"><h3>feed-postgresql-query-tuning — PostgreSQL 쿼리 최적화</h3><blockquote><p>개인 프로젝트 · 2025.03 ~ 2025.04 · 1 인 · 분석 / 구현 / 검증 <a href="https://github.com/donghyeon-ka/feed-postgresql-query-tuning">github.com/donghyeon-ka/feed-postgresql-query-tuning</a></p></blockquote><p>피드 목록 조회 쿼리를 실행 계획 기준으로 분석하고, 실제 접근 패턴에 맞춰 쿼리 책임과 인덱스 구조를 다시 설계한 프로젝트입니다.</p><ul><li><code>EXPLAIN ANALYZE</code> 기준 피드 목록 조회 쿼리 실행 시간을 <strong>1.77 s → 7.66 ms</strong>로 개선했습니다.</li><li>주요 병목으로 4-table <code>LEFT JOIN</code>에 따른 row 폭증, 사용 가능한 인덱스 부재로 인한 sequential scan, 디스크 기반 외부 정렬(<code>Sort Method: external merge Disk</code>)을 확인했습니다.</li><li>불필요한 <code>LEFT JOIN</code>을 <code>EXISTS</code> 서브쿼리로 바꾸고, 페이지네이션과 상세 로딩 책임을 분리해 실행 시간을 <strong>1.77 s → 0.216 s</strong>로 줄였습니다.</li><li>WHERE 조건과 정렬 키를 함께 고려한 복합 인덱스, 자주 조회되는 컬럼을 포함한 커버링 인덱스를 적용해 <strong>0.216 s → 7.66 ms</strong>까지 줄였습니다.</li><li>공개 피드에는 Redis 2 단계 캐시를 적용하고 private 피드는 캐시를 우회하도록 분리했습니다. 테스트 구간에서 약 <strong>90% cache hit rate</strong>를 관찰했습니다.</li><li>단일 인스턴스 환경에서 Locust 1,000 동시 사용자 시나리오를 실행해 약 <strong>900~1,100 RPS</strong> 구간을 확인했습니다.</li><li>JPA 측면에서는 N+1을 피하고, 기본 LAZY 로딩과 필요한 지점의 명시적 fetch join을 분리했으며, <code>Page</code> 응답의 count 쿼리를 별도로 다뤘습니다.</li></ul><p><code>PostgreSQL</code> <code>EXPLAIN ANALYZE</code> <code>Index design</code> <code>JPA</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 인증 서버에서 도메인 규칙, 영속성 매핑, 트랜잭션 소유권을 분리해 구현한 프로젝트입니다.</p><ul><li>Flyway V1~V5로 PostgreSQL 스키마 변경을 관리하고, <code>auth</code> 스키마 생성 / 사용자 도메인 테이블 / Keycloak provider 컬럼 추가를 단계별로 분리했습니다.</li><li>트랜잭션 소유권을 application use case로 이동시켜 infrastructure adapter가 비즈니스 트랜잭션 범위를 결정하지 않도록 정리했습니다.</li><li>저장된 row를 도메인 객체로 복원하는 과정에서 잘못된 데이터가 발견되면 일반 도메인 검증 실패가 아니라 인프라 무결성 문제로 번역했습니다.</li><li>DB row와 <code>UserEmail</code>, <code>UserName</code>, <code>User</code> 같은 도메인 값 객체를 분리해 JPA entity 관심사 밖에서 invariant를 검증했습니다.</li></ul><p><code>Java 21</code> <code>Spring Boot</code> <code>PostgreSQL</code> <code>JPA</code> <code>Flyway</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 위에 구성하면서 데이터 저장소와 배포 단계의 책임을 분리한 프로젝트입니다.</p><ul><li>애플리케이션 row 데이터는 PostgreSQL, object storage는 MinIO, Docker Registry 저장소는 MinIO S3 backend로 분리했습니다.</li><li>Flyway 마이그레이션 실행을 애플리케이션 시작과 분리해, 스키마 변경이 앱 배포보다 먼저 실행될 수 있도록 구성했습니다.</li><li>외부 image push 인증은 Traefik BasicAuth, 내부 image pull은 Kubernetes <code>imagePullSecret</code>으로 나눠 인증 경계를 분리했습니다.</li></ul><p><code>Kubernetes</code> <code>K3s</code> <code>PostgreSQL</code> <code>MinIO</code> <code>Docker Registry</code> <code>Flyway</code> <code>Kustomize</code></p><hr></section>
|
||||
<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><li><strong>Blog</strong>: <a href="https://velog.io/@donghyeon2">velog.io/@donghyeon2</a></li></ul>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
BIN
Binary file not shown.
Vendored
+209
@@ -0,0 +1,209 @@
|
||||
<!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>
|
||||
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"scripts": {
|
||||
"pdf": "node scripts/md-to-pdf.mjs"
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
: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;
|
||||
}
|
||||
@@ -0,0 +1,352 @@
|
||||
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { basename, dirname, extname, resolve } from "node:path";
|
||||
import { spawn, spawnSync } from "node:child_process";
|
||||
|
||||
const inputArg = process.argv[2];
|
||||
|
||||
if (!inputArg) {
|
||||
console.error("Usage: npm run pdf -- <resume.md> [output.pdf]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const inputPath = resolve(inputArg);
|
||||
const outputPath = resolve(process.argv[3] ?? `dist/${basename(inputPath, extname(inputPath))}.pdf`);
|
||||
const htmlPath = outputPath.replace(/\.pdf$/i, ".html");
|
||||
const cssPath = resolve("resume.css");
|
||||
const markdown = readFileSync(inputPath, "utf8");
|
||||
const css = readFileSync(cssPath, "utf8");
|
||||
|
||||
mkdirSync(dirname(outputPath), { recursive: true });
|
||||
|
||||
const html = `<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>${escapeHtml(basename(inputPath, extname(inputPath)))}</title>
|
||||
<style>${css}</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
${renderMarkdown(markdown)}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
async function printPdfWithChrome(sourceHtmlPath, targetPdfPath) {
|
||||
const chrome = findChrome();
|
||||
const userDataDir = mkdtempSync(resolve(tmpdir(), "resume-chrome-"));
|
||||
const chromeProcess = spawn(chrome, [
|
||||
"--headless",
|
||||
"--disable-gpu",
|
||||
"--no-sandbox",
|
||||
"--remote-debugging-port=0",
|
||||
`--user-data-dir=${userDataDir}`,
|
||||
"about:blank",
|
||||
], {
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
});
|
||||
|
||||
let stderr = "";
|
||||
chromeProcess.stderr.on("data", (chunk) => {
|
||||
stderr += chunk.toString();
|
||||
});
|
||||
|
||||
try {
|
||||
const browserWsUrl = await readBrowserWsUrl(userDataDir, chromeProcess);
|
||||
const tab = await createTab(browserWsUrl, `file://${sourceHtmlPath}`);
|
||||
const pdfBase64 = await printTabToPdf(tab.webSocketDebuggerUrl);
|
||||
writeFileSync(targetPdfPath, Buffer.from(pdfBase64, "base64"));
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
if (stderr.trim()) {
|
||||
console.error(stderr.trim());
|
||||
}
|
||||
process.exitCode = 1;
|
||||
} finally {
|
||||
chromeProcess.kill("SIGTERM");
|
||||
rmSync(userDataDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
if (process.exitCode) {
|
||||
process.exit(process.exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
async function readBrowserWsUrl(userDataDir, chromeProcess) {
|
||||
const activePortPath = resolve(userDataDir, "DevToolsActivePort");
|
||||
|
||||
for (let attempt = 0; attempt < 100; attempt += 1) {
|
||||
if (chromeProcess.exitCode !== null) {
|
||||
throw new Error(`Chrome exited before DevTools became available. Exit code: ${chromeProcess.exitCode}`);
|
||||
}
|
||||
|
||||
try {
|
||||
const [port, path] = readFileSync(activePortPath, "utf8").trim().split("\n");
|
||||
return `ws://127.0.0.1:${port}${path}`;
|
||||
} catch {
|
||||
await delay(50);
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("Timed out while waiting for Chrome DevTools.");
|
||||
}
|
||||
|
||||
async function createTab(browserWsUrl, url) {
|
||||
const browser = new CdpClient(browserWsUrl);
|
||||
await browser.open();
|
||||
const { targetId } = await browser.send("Target.createTarget", { url });
|
||||
await browser.close();
|
||||
|
||||
const targetsUrl = `http://${new URL(browserWsUrl).host}/json/list`;
|
||||
for (let attempt = 0; attempt < 100; attempt += 1) {
|
||||
const targets = await fetch(targetsUrl).then((response) => response.json());
|
||||
const tab = targets.find((target) => target.id === targetId);
|
||||
if (tab?.webSocketDebuggerUrl) {
|
||||
return tab;
|
||||
}
|
||||
await delay(50);
|
||||
}
|
||||
|
||||
throw new Error("Timed out while opening the HTML tab.");
|
||||
}
|
||||
|
||||
async function printTabToPdf(tabWsUrl) {
|
||||
const tab = new CdpClient(tabWsUrl);
|
||||
await tab.open();
|
||||
await tab.send("Page.enable");
|
||||
await delay(300);
|
||||
await tab.send("Page.getLayoutMetrics");
|
||||
const result = await tab.send("Page.printToPDF", {
|
||||
displayHeaderFooter: false,
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true,
|
||||
});
|
||||
await tab.close();
|
||||
return result.data;
|
||||
}
|
||||
|
||||
class CdpClient {
|
||||
constructor(url) {
|
||||
this.url = url;
|
||||
this.nextId = 1;
|
||||
this.pending = new Map();
|
||||
}
|
||||
|
||||
open() {
|
||||
return new Promise((resolveOpen, rejectOpen) => {
|
||||
this.ws = new WebSocket(this.url);
|
||||
this.ws.onopen = () => resolveOpen();
|
||||
this.ws.onerror = () => rejectOpen(new Error(`Failed to connect to ${this.url}`));
|
||||
this.ws.onmessage = (event) => {
|
||||
const message = JSON.parse(event.data);
|
||||
const pending = this.pending.get(message.id);
|
||||
if (!pending) {
|
||||
return;
|
||||
}
|
||||
this.pending.delete(message.id);
|
||||
if (message.error) {
|
||||
pending.reject(new Error(message.error.message));
|
||||
} else {
|
||||
pending.resolve(message.result);
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
send(method, params = {}) {
|
||||
const id = this.nextId;
|
||||
this.nextId += 1;
|
||||
const payload = JSON.stringify({ id, method, params });
|
||||
|
||||
return new Promise((resolveSend, rejectSend) => {
|
||||
this.pending.set(id, { resolve: resolveSend, reject: rejectSend });
|
||||
this.ws.send(payload);
|
||||
});
|
||||
}
|
||||
|
||||
close() {
|
||||
this.ws.close();
|
||||
}
|
||||
}
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise((resolveDelay) => setTimeout(resolveDelay, ms));
|
||||
}
|
||||
|
||||
function findChrome() {
|
||||
const candidates = [
|
||||
process.env.CHROME_BIN,
|
||||
"google-chrome",
|
||||
"google-chrome-stable",
|
||||
"chromium",
|
||||
"chromium-browser",
|
||||
].filter(Boolean);
|
||||
|
||||
for (const candidate of candidates) {
|
||||
const found = spawnSync("which", [candidate], { encoding: "utf8" });
|
||||
if (found.status === 0) {
|
||||
return found.stdout.trim();
|
||||
}
|
||||
}
|
||||
|
||||
console.error("Chrome executable not found. Install Google Chrome or Chromium first.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function renderMarkdown(source) {
|
||||
const lines = source.replace(/\r\n/g, "\n").split("\n");
|
||||
const blocks = [];
|
||||
|
||||
for (let index = 0; index < lines.length;) {
|
||||
const line = lines[index];
|
||||
|
||||
if (!line.trim()) {
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
const heading = /^(#{1,3})\s+(.+)$/.exec(line);
|
||||
if (heading) {
|
||||
const level = heading[1].length;
|
||||
blocks.push(`<h${level}>${inline(heading[2])}</h${level}>`);
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (/^---+$/.test(line.trim())) {
|
||||
blocks.push("<hr>");
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isTableStart(lines, index)) {
|
||||
const rows = [];
|
||||
rows.push(parseTableRow(lines[index]));
|
||||
index += 2;
|
||||
while (index < lines.length && /^\|.*\|$/.test(lines[index].trim())) {
|
||||
rows.push(parseTableRow(lines[index]));
|
||||
index += 1;
|
||||
}
|
||||
blocks.push(renderTable(rows));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line.startsWith(">")) {
|
||||
const quoteLines = [];
|
||||
while (index < lines.length && lines[index].startsWith(">")) {
|
||||
quoteLines.push(lines[index].replace(/^>\s?/, ""));
|
||||
index += 1;
|
||||
}
|
||||
blocks.push(`<blockquote>${renderParagraphs(quoteLines)}</blockquote>`);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (/^-\s+/.test(line)) {
|
||||
const items = [];
|
||||
while (index < lines.length && /^-\s+/.test(lines[index])) {
|
||||
items.push(lines[index].replace(/^-\s+/, ""));
|
||||
index += 1;
|
||||
}
|
||||
blocks.push(`<ul>${items.map((item) => `<li>${inline(item)}</li>`).join("")}</ul>`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const paragraph = [];
|
||||
while (
|
||||
index < lines.length &&
|
||||
lines[index].trim() &&
|
||||
!/^(#{1,3})\s+/.test(lines[index]) &&
|
||||
!/^---+$/.test(lines[index].trim()) &&
|
||||
!lines[index].startsWith(">") &&
|
||||
!/^- /.test(lines[index]) &&
|
||||
!isTableStart(lines, index)
|
||||
) {
|
||||
paragraph.push(lines[index].trim());
|
||||
index += 1;
|
||||
}
|
||||
blocks.push(`<p>${inline(paragraph.join(" "))}</p>`);
|
||||
}
|
||||
|
||||
return groupProjectSections(blocks).map((block) => ` ${block}`).join("\n");
|
||||
}
|
||||
|
||||
function groupProjectSections(blocks) {
|
||||
const grouped = [];
|
||||
|
||||
for (let index = 0; index < blocks.length;) {
|
||||
if (!blocks[index].startsWith("<h3>")) {
|
||||
grouped.push(blocks[index]);
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
const section = [];
|
||||
while (
|
||||
index < blocks.length &&
|
||||
!blocks[index].startsWith("<h2>") &&
|
||||
(section.length === 0 || !blocks[index].startsWith("<h3>"))
|
||||
) {
|
||||
section.push(blocks[index]);
|
||||
index += 1;
|
||||
}
|
||||
grouped.push(`<section class="project">${section.join("")}</section>`);
|
||||
}
|
||||
|
||||
return grouped;
|
||||
}
|
||||
|
||||
function renderParagraphs(lines) {
|
||||
return lines
|
||||
.join("\n")
|
||||
.split(/\n\s*\n/)
|
||||
.map((paragraph) => `<p>${inline(paragraph.replace(/\n/g, " ").trim())}</p>`)
|
||||
.join("");
|
||||
}
|
||||
|
||||
function isTableStart(lines, index) {
|
||||
return (
|
||||
index + 1 < lines.length &&
|
||||
/^\|.*\|$/.test(lines[index].trim()) &&
|
||||
/^\|\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?$/.test(lines[index + 1].trim())
|
||||
);
|
||||
}
|
||||
|
||||
function parseTableRow(line) {
|
||||
return line
|
||||
.trim()
|
||||
.replace(/^\|/, "")
|
||||
.replace(/\|$/, "")
|
||||
.split("|")
|
||||
.map((cell) => cell.trim());
|
||||
}
|
||||
|
||||
function renderTable(rows) {
|
||||
return `<table><tbody>${rows
|
||||
.map((row) => `<tr>${row.map((cell) => `<td>${inline(cell)}</td>`).join("")}</tr>`)
|
||||
.join("")}</tbody></table>`;
|
||||
}
|
||||
|
||||
function inline(value) {
|
||||
return escapeHtml(value)
|
||||
.replace(/`([^`]+)`/g, "<code>$1</code>")
|
||||
.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")
|
||||
.replace(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, '<a href="$2">$1</a>');
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
return value
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
writeFileSync(htmlPath, html);
|
||||
|
||||
await printPdfWithChrome(htmlPath, outputPath);
|
||||
|
||||
console.log(`HTML: ${htmlPath}`);
|
||||
console.log(`PDF: ${outputPath}`);
|
||||
Reference in New Issue
Block a user