Search code examples
elasticsearchasp.net-core-2.0nestcqrseventstoredb

Implement CQRS using EventStore with ElasticSearch


I am currently learning CQRS implementation using ElasticSearch and EventStore. So, I decided to use EventStore for saving the serious of event streams into EventStore and I want to use Elastic Search to Query the Data/CurrentState Data from the EventStore.

My Questions are,

1.) Using ElasticSearch, Shall we query the aggregated Data/CurrentState data from EventStore directly or Do we need to Sync/Store the aggregated Data/CurrentState data into the ElasticSearch for Querying?

2.) What is the Proper way to sync/index Event store data into elastic search? Do we need to use any intermediator to sync/index the EventStore data into elastic search? My ultimate aim is to build the CQRS implementation using EventStore for Command and ElasticSearch for Querying.

Note: I am planning to build a system in .net Core using NEST and ElasticSearch.net dll.

Your thoughts are much appreciated.

Thanks in advance.


Solution

  • Since you are in a learning phase, I strongly recommend that you take Elastic and EventStore out of your initial implementation. Focus on CQRS, and implement a simplified version of ES. You don't need a full-blown Event Sourcing approach right at this stage.