> For the complete documentation index, see [llms.txt](https://gunkim.gitbook.io/undefined/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gunkim.gitbook.io/undefined/schema-evolution.md).

# schema-evolution

### 배운 개념

* 부호화(Encoding)의 진짜 목적은 사람의 가독성이 아니라, 메모리 주소(포인터)나 아키텍처 종속성을 없애고 전송/저장 가능한 독립적 바이트열로 변환하는 것.
* **하위 호환성(Backward Compatibility)**: 최신 코드가 과거 데이터를 읽을 수 있음.
* **상위 호환성(Forward Compatibility)**: 과거 코드가 미래의 신규 데이터를 읽을 수 있음 (주체가 코드 버전이 아닌 '데이터 쓰인 시점'임).
* 프로토콜 버퍼 등에서는 필드 추가 시 `optional` 속성을 사용해 하위 호환성을 유지하고, '필드 태그 번호' 메커니즘을 이용해 모르는 태그는 건너뜀(Skip)으로써 상위 호환성을 지킴.

### 오답 및 정정

> \[!WARNING] **오개념**: 부호화의 목적은 데이터를 사람이 읽기 쉽게 만드는 것이며, 상위/하위 호환성은 신버전 코드가 구버전을 지원하는 식의 방향성이다. **정정**: 이진 포맷은 기계 중심이며, 호환성은 코드가 아니라 '데이터가 쓰인 시점'을 기준으로 봐야 함.

### 복습 체크

* [ ] 최신 버전 애플리케이션 코드가 어제 저장된 DB 레코드를 읽는 상황은 무슨 호환성에 해당하는가?
* [ ] 프로토콜 버퍼에서 신규 필드를 required로 추가하면 호환성에 어떤 치명적 문제가 생기는가?

\[\[avro-schema-registry]]


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gunkim.gitbook.io/undefined/schema-evolution.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
