Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/schema-ownership-and-capability-streams/reference/reference-local-with-a-different-db-is-a-different-system.md
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

61 lines
2.6 KiB
Markdown

---
kind: REFERENCE
slug: local-with-a-different-db-is-a-different-system
title: 로컬이 다른 DB면 로컬 테스트는 다른 시스템에 대한 진술이다
topic: schema-ownership-and-capability-streams
project: clean-architecture-backend-template
status: 게시 전
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
rootTreeNode: reference:local-with-a-different-db-is-a-different-system
verifiedOn: # 이 기록은 이번 회차에 실행 확인을 하지 않았다
---
# 로컬이 다른 DB면 로컬 테스트는 다른 시스템에 대한 진술이다
## 목적
로컬에서 초록불이라는 사실을 배포 대상에 대한 증거로 읽는 것을 막는다.
## 규칙
1. 로컬 데이터베이스가 다르면 결과도 다른 시스템의 것이다
방언과 타입 매핑과 제약 처리와 잠금 동작이 다르다.
2. 스키마를 엔티티에서 만드는 구성은 스키마 불일치를 원리적으로 발견하지 못한다
생성 소스와 검증 소스가 같으면 어긋날 수 없다.
3. 실제 데이터베이스에 대한 레인을 별도로 둔다
그 레인이 없으면 이 계열의 결함은 배포 시점에 처음 나타난다.
4. 로컬 설정이 값을 덮어쓰면 기본값의 결함이 로컬에서 보이지 않는다
기본값을 검증하는 경로가 따로 필요하다.
5. 어느 결함이 어느 환경에서만 보이는지 기록한다
그 정보가 다음 사람이 레인을 고를 때 쓰인다.
## 적용 조건
로컬과 배포 대상의 데이터베이스가 다른 모든 프로젝트
프로파일별로 설정 기본값이 덮이는 구성
## 예외
데이터베이스에 의존하지 않는 순수 로직 테스트는 이 규칙의 대상이 아니다.
## 예시
고정 길이와 가변 길이 컬럼 타입 불일치가 실제 PostgreSQL 검증에서 기동 실패를 냈고, 로컬이 H2 로 도는 동안에는 보이지 않았다. H2 구성은 엔티티에서 스키마를 만들므로 엔티티와 어긋날 수 없다.
풀 커넥션 타임아웃 기본값의 형식 오류가 prod 와 dev 배포를 전부 실패시켰고 로컬만 통과했다. 로컬 프로파일 파일이 그 값을 덮어쓴다.
## 관계
- **char(64)와 varchar(64) 불일치를 H2가 가리고 있었다**
이 규칙을 만든 사례다.
- **connection-timeout이 5s 문자열로 출하되어 prod와 dev 배포가 전부 시작에 실패했다**
네 번째 규칙의 사례다.
- **컨테이너가 필요한 특수 레인의 실제 결과를 실행으로 확인하지 않았다**
실제 데이터베이스 레인의 현재 상태에 대한 질문이다.