Skip to content
cccskills
FreePublished on GitHub

scalardb-transaction

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

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

See how to install

Files included (1)

  • SKILL.md5.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

ScalarDB Transaction Design Skill

目的

ScalarDB のトランザクションパターンを選定・設計し、以下を生成する:

  • トランザクション境界定義
  • パターン選定結果と根拠
  • OCC競合率評価
  • バッチ処理設計
  • v3.17 最適化適用計画
  • エラーハンドリング・リトライ戦略

リファレンス資料

資料パス参照内容
トランザクションモデルresearch/07_transaction_model.md7つのトランザクションパターン
バッチ処理research/09_batch_processing.mdバッチ有効/無効ケース、チャンクサイズ
ScalarDB 3.17research/13_scalardb_317_deep_dive.md最適化機能の詳細
ワークフロー05workflow/05_transaction_design.mdStep 05 手順

実行フロー

Stage 1: トランザクション境界の定義

Step 04(データモデル)の結果を基に、各ビジネスプロセスのトランザクション境界を定義する。

トランザクション境界テンプレート:

トランザクション名ビジネスプロセス関与集約関与テーブル操作種別
Read/Write/ReadWrite

Stage 2: トランザクションパターン選定

各トランザクションに対してパターンを選定:

パターン適用条件ScalarDB API
単一集約内1サービス・1テーブルDistributedTransaction
単一サービス複数テーブル1サービス・複数テーブルDistributedTransaction
2PC(2サービス)2サービス間ACIDTwoPhaseCommitTransaction
2PC(3サービス)3サービス間ACID(上限)TwoPhaseCommitTransaction
Saga結果整合性で十分アプリケーション実装
Saga + 部分2PC一部ACIDが必要ハイブリッド

パターン選定マトリクス:

トランザクション名選定パターン根拠リスク

Stage 3: OCC 競合率評価

楽観的並行性制御(OCC)の競合率を評価し、対策を検討する。

競合率評価テンプレート:

トランザクション対象レコード同時実行数推定競合率許容範囲対策
< 5%

競合率が高い場合の対策:

  1. Partition Key の見直し(アクセス分散)
  2. トランザクション範囲の縮小
  3. リトライ戦略の調整
  4. ビジネスプロセスの再設計(Saga化検討)

Stage 4: バッチ処理設計

バッチ処理テンプレート:

バッチ名処理内容対象テーブル予想レコード数チャンクサイズトランザクション範囲
100-1000推奨チャンク単位

ScalarDB バッチ処理の制約:

  • 長時間トランザクションは OCC 競合リスクが高い
  • チャンク単位でコミットする設計が必須
  • Batch Operations(v3.17)で複数操作を一括送信可能

Stage 5: v3.17 最適化適用計画

最適化機能適用対象効果設定
Piggyback Begin全トランザクションラウンドトリップ -1有効化推奨
Write Buffering書き込み多いTxネットワーク呼出削減対象Txで有効化
Batch Operationsバッチ処理スループット向上バッチ処理で使用
Tx Metadata Decoupling小レコードテーブルストレージ効率化READレイテンシ影響を評価

Stage 6: エラーハンドリング・リトライ戦略

エラーハンドリングテンプレート:

例外原因対応リトライ
CrudConflictExceptionOCC競合リトライYes(指数バックオフ)
CommitConflictExceptionコミット時競合リトライYes(指数バックオフ)
UnknownTransactionStatusException状態不明確認→リトライ or 補償条件付き
CommitExceptionコミット失敗abort→リトライYes
UnsatisfiedConditionException条件未達ビジネスロジック判断No

リトライ設定テンプレート:

パラメータ推奨値説明
最大リトライ回数3-5過度なリトライは避ける
初回待機時間100ms指数バックオフの起点
最大待機時間5000ms上限
バックオフ係数2.0倍増
ジッター±50ms同時リトライの分散

Stage 7: 出力

成果物を output/phase2/05_transaction_design.md に出力。


使用例

/plan-step 05

Step 04 のデータモデルに基づいてトランザクション設計を行ってください。
特に以下のプロセスの設計を重視:
- 注文確定(注文 + 在庫 + 決済の3サービス跨ぎ)
- ポイント付与(結果整合性で可)
- 月次バッチ集計

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

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