HappYness-Project / Happy-EventSourcing

Event sourcing
10 stars 1 forks source link

Create Domain Read model for Todo. #80

Open hyunbin7303 opened 1 year ago

hyunbin7303 commented 1 year ago

For the eventsourcing-CQRS pattern, it separates write side(Command) and read side(Query). For the read side, it is desirable to create its own read domain entity for the Todo.

Read model - > any complex logic they encaplsuation is executed asynchronously during event projection. A read model projection function can access existing persistent data, run calcuations of any complexity, and generate as much new or modified data as necessary. The loger a projection takes, the greater the latency of the system,

hyunbin7303 commented 1 year ago

source from : https://cqrs.nu/tutorial/cs/03-read-models

A read model is a model specialized for reads, that is, queries. It takes events produced by the domain and uses them to build and maintain a model that is suitable for answering the client's queries. It may build and maintain...

  • An in-memory model of the data.
  • A relational model of the data, stored in an RDBMS.
  • Documents, stored in a document database.
  • A graph model of the data, stored in a graph database.
  • A search index.
  • An xml,csv, excel sheet etc.
hyunbin7303 commented 1 year ago

https://www.ibm.com/cloud/architecture/architectures/event-driven-cqrs-pattern/

hyunbin7303 commented 1 year ago

Projections

TodoDetails or TodoViews (Read models) are not the only possible outcome of events streaming processing. Such streams can be used for various tasks.

https://blog.eventuous.dev/read-models-in-event-sourced-systems-489342181233