Skip to content
cccskills
FreePublished on GitHub

scalardb-data-model

ScalarDBの制約を考慮したデータモデル設計を行います。Partition Key・Clustering Key・Secondary Index の設計、ホットスポット評価、メタデータオーバーヘッド見積もり、バックエンドDB選定を含みます。ワークフローStep 04(データモデル設計)で使用します。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

ScalarDB Data Model Design Skill

目的

ScalarDB の制約と最適化を考慮したデータモデルを設計し、以下を生成する:

  • テーブルスキーマ定義(ScalarDB形式)
  • PK/CK/SI 設計と根拠
  • ホットスポットリスク評価
  • メタデータオーバーヘッド見積もり
  • バックエンドDB選定結果

リファレンス資料

資料パス参照内容
論理データモデルresearch/03_logical_data_model.md7つのデータモデルパターン
物理データモデルresearch/04_physical_data_model.mdPK/CK/SI設計、パフォーマンス
DB調査research/05_database_investigation.md対応DB一覧、特性比較
ScalarDB 3.17research/13_scalardb_317_deep_dive.mdメタデータ分離機能
ワークフロー04workflow/04_data_model_design.mdStep 04 手順
データモデルテンプレートworkflow/templates/data_model_template.mdテーブル設計テンプレート

実行フロー

Stage 1: 入力の確認

  1. Step 01(要件分析)と Step 03(適用範囲)の成果物を読み込む
  2. ScalarDB管理対象テーブル一覧を確認
  3. ドメインモデル(Step 02)から集約構造を確認

Stage 2: テーブルスキーマ設計

各テーブルについて以下を定義:

テーブル定義テンプレート:

### テーブル: {namespace}.{table_name}

#### 基本情報
| 項目 | 値 |
|------|-----|
| 名前空間 | {namespace} |
| テーブル名 | {table_name} |
| 所有サービス | {service} |
| ScalarDB管理 | Yes/No |
| バックエンドDB | {db_type} |

#### カラム定義
| カラム名 | ScalarDB型 | キー種別 | 説明 |
|---------|-----------|---------|------|
| {col} | TEXT/INT/BIGINT/FLOAT/DOUBLE/BOOLEAN/BLOB | PK/CK(ASC/DESC)/SI/- | {desc} |

#### キー設計

**Partition Key**: `{column}`
- 選定理由: {reason}
- カーディナリティ: High/Mid/Low
- ホットスポットリスク: High/Mid/Low

**Clustering Key**: `{column} {ASC/DESC}`
- 選定理由: {reason}
- アクセスパターン: {pattern}

**Secondary Index**: `{column}`(必要な場合のみ)
- 選定理由: {reason}
- パフォーマンス影響: {impact}

Stage 3: ホットスポット評価

各テーブルの Partition Key について:

テーブルPKカーディナリティアクセス偏りリスク対策
High/Mid/Low均等/偏ありHigh/Mid/Low{対策}

対策パターン:

  • ハッシュプレフィックス付与
  • 複合キーの導入
  • テーブル分割
  • 時系列データのバケット化

Stage 4: メタデータオーバーヘッド見積もり

テーブル予想レコード数レコードサイズメタデータオーバーヘッド率
{bytes}~200 bytes{percentage}%

Transaction Metadata Decoupling 適用判断:

  • レコードサイズが小さい(< 1KB)場合はオーバーヘッド率が高くなるため検討
  • ただし READ レイテンシへの影響を評価すること

Stage 5: バックエンドDB選定

テーブル群推奨DB選定理由代替案

選定基準:

  • ScalarDB対応状況(research/05_database_investigation.md 参照)
  • データアクセスパターン(OLTP/OLAP)
  • スケーラビリティ要件
  • 運用コスト
  • チームの習熟度

Stage 6: 出力

成果物を output/phase2/04_data_model_design.md に出力。


ScalarDB 対応データ型

ScalarDB型説明
BOOLEAN真偽値
INT32ビット整数
BIGINT64ビット整数
FLOAT32ビット浮動小数点
DOUBLE64ビット浮動小数点
TEXT文字列
BLOBバイナリ

使用例

/plan-step 04

Phase 1 の結果に基づいてデータモデルを設計してください。
対象サービス: 注文サービス、在庫サービス、決済サービス
バックエンドDB候補: MySQL 8.0, Amazon DynamoDB

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

RESTful API の設計を行います。エンドポイント定義、リクエスト/レスポンス仕様、エラーハンドリング、ScalarDBトランザクション例外のマッピングを含みます。

The English summary is being prepared. Showing the original description.

wfukatsu/coding-agent-for-scalardb6Updated Feb 19, 2026

ScalarDBを前提としたデータベース設計を行います。スキーマ設計、トランザクション設計、マルチストレージ構成を対話形式で決定し、スキーマファイルと設計書を生成します。

The English summary is being prepared. Showing the original description.

wfukatsu/coding-agent-for-scalardb6Updated Feb 19, 2026

DDDに基づいたドメインモデルを設計します。戦略的設計(境界コンテキスト、ユビキタス言語)と戦術的設計(エンティティ、値オブジェクト、集約、ドメインサービス、ドメインイベント)を定義し、ヘキサゴナルアーキテクチャとの統合を行います。ScalarDBのトランザクション境界や管理テーブル分類の考慮事項を含みます。中間状態はresearch/に記録されます。

The English summary is being prepared. Showing the original description.

wfukatsu/coding-agent-for-scalardb6Updated Feb 19, 2026

設計ドキュメントに基づいて実装計画を生成します。ScalarDB特有のスキーマ定義、トランザクション実装、統合テストを含む実装可能なタスク指示書を作成し、フェーズ別の実装ロードマップを提供します。

The English summary is being prepared. Showing the original description.

wfukatsu/coding-agent-for-scalardb6Updated Feb 19, 2026

Kubernetes、Kong API Gateway、ScalarDB Cluster v3.17を使用したインフラストラクチャ設計を行います。マニフェストファイルと設定ファイルを生成します。

The English summary is being prepared. Showing the original description.

wfukatsu/coding-agent-for-scalardb6Updated Feb 19, 2026

ScalarDBのトランザクション設計を行います。トランザクション境界定義、パターン選定(単一集約内/2PC/Saga/ハイブリッド)、OCC競合率評価、バッチ処理設計、v3.17最適化適用計画を含みます。ワークフローStep 05(トランザクション設計)で使用します。

The English summary is being prepared. Showing the original description.

wfukatsu/coding-agent-for-scalardb6Updated Feb 19, 2026

See all skills by wfukatsu

Report a problem with this skill