LoginSignup
18
14

More than 5 years have passed since last update.

EventStoreの概念図

Last updated at Posted at 2014-11-16

EventStoreは、append-only databaseの一種で、ドメインイベントを保存するためのストレージ。一度追加したEventは変更や削除をすることができない。追加したEventは古いものから順にevent idが連番で付与される。EventStoreには複数のEventStreamが保存される。EventStreamは、ドメイン駆動設計のAggregateの1インスタンスに対応する。EventStreamは複数のEventを持つ。stream versionはひとつのEventStreamが何度更新されたか、つまりいくつEventを持っているかを表現する。
 
Eventはその型であるtypeを持つ。typeの名前には、ドメインイベントのクラス名と同じで、過去分詞形の名前を使われる。bodyはドメインイベントをシリアライズした文字列データが入る。

EventStoreのインターフェイスは、追加(append)とストリーム単位での取り出し(stream)、ストアにある全イベントの取り出し(events)を提供する。streamとeventsは、sinceを指定することである時点からのイベントを取り出すこともできる。

18
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
14