コンテンツにスキップ

データモデル設計

概要

リツビ BtoB ECサイトのデータモデル設計書です。

データベース設計原則

  1. データ整合性: 外部キー制約によるデータの整合性保持
  2. 正規化: 適切な正規化レベルでの冗長性排除
  3. パフォーマンス: インデックス設計による検索性能最適化
  4. 拡張性: 将来の機能追加に対応できる柔軟な設計

主要エンティティ

Customer(顧客)

  • 顧客基本情報
  • 顧客ステータス(15種類)
  • 掛率設定
  • 与信情報

Product(商品)

  • 商品基本情報
  • カテゴリー(33カテゴリーの階層構造)
  • 在庫情報
  • 価格情報

Order(注文)

  • 注文基本情報
  • 注文明細
  • 配送情報
  • 支払情報

Campaign(キャンペーン)

  • キャンペーン基本設定
  • 適用条件
  • 特典内容
  • 期間管理

ER図

erDiagram
    Customer ||--o{ Order : places
    Customer {
        string id
        string name
        string status
        decimal discountRate
        decimal creditLimit
    }

    Order ||--o{ OrderItem : contains
    Order {
        string id
        string customerId
        datetime orderDate
        decimal totalAmount
        string status
    }

    Product ||--o{ OrderItem : ordered
    Product {
        string id
        string name
        string categoryId
        decimal price
        int stock
    }

    OrderItem {
        string orderId
        string productId
        int quantity
        decimal unitPrice
    }

データ移行計画

  1. 既存システムからのデータ抽出
  2. データクレンジング
  3. Vendureスキーマへのマッピング
  4. 段階的データ移行
  5. 整合性チェック

今後の作業

  • 詳細テーブル定義書の作成
  • インデックス設計書の作成
  • データ移行手順書の作成
  • バックアップ・リストア手順書の作成