Database Normalization
データベース正規化
データベース正規化は、関連する事実を整ったテーブルに分割します。これにより、データの重複や、ある事実が変更されたときのミスを減らせます。
もう一つの例
クリニックは、患者の電話番号、医師の名前、3つの薬の列をすべての訪問行にコピーするのをやめます。患者、医師、訪問、および `visit_medications` が関連するテーブルになります。電話番号の変更は1つの事実だけを更新し、チェック済みのレポートビューだけがデータを統合して速やかな閲覧を可能にします。
主な部分
- 01事実と依存関係
- 02キーと関連
- 03異常のない更新
以下の場合に使用します
事実、その依存関係、およびキーを使用して、1つの信頼できる真実の情報源を構築してください。パフォーマンスの証拠がある場合にのみ、後で非正規化してください。
以下の場合は使用しないでください
実際のデータ関係と一致しないまま、高次正規形を追い求めないでください。明確な所有権と同期ルールがないまま、早期に非正規化を行わないでください。
コードで使用する名前
functional dependencies + candidate keys + 1NF/2NF/3NF/BCNF as appropriate 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with データベース正規化 (Database Normalization)。 User context:クリニックは、患者の電話番号、医師の名前、3つの薬の列をすべての訪問行にコピーするのをやめます。患者、医師、訪問、および `visit_medications` が関連するテーブルになります。電話番号の変更は1つの事実だけを更新し、チェック済みのレポートビューだけがデータを統合して速やかな閲覧を可能にします。 Technical concept or control:データベース正規化 (Database Normalization)。 Why it fits:事実、その依存関係、およびキーを使用して、1つの信頼できる真実の情報源を構築してください。パフォーマンスの証拠がある場合にのみ、後で非正規化してください。 Do not use it when:実際のデータ関係と一致しないまま、高次正規形を追い求めないでください。明確な所有権と同期ルールがないまま、早期に非正規化を行わないでください。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):単一の公式標準が全体の用語を管理するわけではありません。その意味はチーム、プラットフォーム、またはフレームワークによって変わる可能性があります。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how データベース正規化 (Database Normalization) is used now. Definition: データベース正規化は、関連する事実を整ったテーブルに分割します。これにより、データの重複や、ある事実が変更されたときのミスを減らせます。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.