CQRS とは?
CQRS(command query responsibility segregation)は、アプリケーションを command を処理する書き込み側と query に答える読み取り側に分割し、それぞれが独自のモデルを持つパターンです。command はビジネスルールを適用し、読み取りは高速な取得のために構築された非正規化のプロジェクションを使います。両側は異なるストレージを使い、別々にスケールできます。
なぜ重要か
読み取りと書き込みを分離することで、単一の共有 schema で妥協する代わりに、それぞれを自身のアクセスパターンに最適化できます。コストは追加の複雑さと、読み取りモデルを同期させ続ける必要性です。
関連ガイド
What Is a Command Handler?A command handler is the component that receives a command requesting a change, validates it, and executes th…
What Is a Query Handler?A query handler is the component that answers a read request by fetching and shaping data, without changing a…
What Is Event Sourcing?Event sourcing stores state as an append-only log of events rather than current values, rebuilding state by r…