"매 schema 의 핵심: structure + constraints + evolution + 매 contract between producers/consumers". 매 1970 Codd relational model 으로 시작, 매 2000s schemaless / NoSQL backlash, 매 2020s schema-on-read 의 한계 인식 후 매 type-safe 회귀 (Zod, TypeScript-first ORMs, dbt contracts). 매 2026 현재 schema-as-code + version-aware evolution 의 standard.
매 핵심
매 schema layers
Conceptual: 매 ERD — 매 business entities.
Logical: 매 normalized tables — 매 BCNF/3NF.
Physical: 매 indexes, partitions, storage.
API/Wire: 매 JSON Schema, Avro, Protobuf, GraphQL.
Validation: 매 Zod, Pydantic, Joi (runtime).
매 evolution principles
Backward compatible: 매 add nullable / default 만 — 매 reader of old schema 의 새 data read 가능.
Forward compatible: 매 unknown field 의 ignore.
Full compatible: 매 둘 다.
SemVer for schemas: 매 breaking = major bump.
매 응용
Database schema (Postgres, MySQL, BigQuery).
Event streaming (Kafka + Schema Registry).
API contracts (OpenAPI, GraphQL, tRPC).
Data lake / lakehouse (Iceberg, Delta Lake schema).
Form validation (frontend + backend shared via Zod).
언제: 매 schema drafting from natural-language requirements, 매 migration generation, 매 schema diff explanation, 매 cross-format conversion (Postgres ↔ Avro ↔ Protobuf).
언제 X: 매 production migrations 의 LLM 의 단독 실행 X — 매 review + dry-run 필수.
❌ 안티패턴
Schema-on-read everything: 매 cost 는 consumer 가 부담 — 매 chaos.
Breaking changes without versioning: 매 consumer outage.
Storing JSON blobs in JSON column without structure: 매 query nightmare.
No NOT NULL / no FK / no CHECK: 매 DB 의 dumb storage 화.
Reusing field IDs in protobuf: 매 wire incompatibility.
Adding required field 의 backward compatibility 위반.