Contract 가 해결하는 문제
Producer 팀이 schema 변경 ship. Consumer 팀 파이프라인이 새벽 6시에 깨짐. Consumer 팀 화남. Producer 팀은 자기 테이블 누가 읽는지 몰랐어. 데이터 만드는 팀 두 개 이상 가진 회사에서 가장 흔한 cross-team 데이터 outage. Fix 는 data contract.
Contract 가 가지는 것
- Schema — column 이름, type, nullability, 허용 값.
- Freshness — "오전 9시까지 가능, 99.5% 일자."
- 소유권 — 생산 팀 이름과 on-call 채널.
- Breaking-change 정책 — column 제거 전 얼마나 알림; column rename 마이그레이션 처리법.
- Versioning — additive vs breaking 변경; downstream consumer 가 opt-in 해야 하나.
Contract 가 아닌 것
Contract 는 아무도 안 읽는 위키 페이지가 아니야. 코드에 의해 enforce 되는 산출물 — producer write 단계에서 schema 검증, 자동화된 freshness 체크, 모든 PR 에 현재 schema 를 선언된 contract 와 비교하는 CI 테스트. 문서의 contract 는 wishful thinking; CI 의 contract 는 load-bearing wall.