EventFlow icon indicating copy to clipboard operation
EventFlow copied to clipboard

How to use MSSQL and FILES EventStore same time?

Open ppXD opened this issue 9 years ago • 3 comments

IRootResolver rootResolver = EventFlowOptions.New ... .UseMssqlEventStore() .UseFilesEventStore(storePath) .CreateResolver();

it will be only record the event to files.

ppXD avatar Jul 13 '17 07:07 ppXD

Obviously you have to create a wrapper which implements IEventStore interface and internally has dependencies on desired stores then calls these dependencies

romanstetsenko avatar Jul 13 '17 11:07 romanstetsenko

@ppXD I wouldn't recommend it as you would most likely end up in a inconsistent state, e.g. if a optimistic concurrency exceptions happen in one and not in the other event store. Personally I like to think the event store as the single source of truth, so having two of them defeats that.

If you simply would like to create a backup of all events emitted, then register the ISubscribeSynchronousToAll and then use the IEventJsonSerializer to serialize the events to JSON. Writing these to disk should then be trivial.

As a side note. I am working on an event archive function for EventFlow, but don't know when its going to be ready as I'm trying to implement event streams (which is a mess right now) as part of it (handling cases were you can't load all events into memory).

rasmus avatar Jul 13 '17 13:07 rasmus

@rasmus Thank you very much, Implement ISubscribeSynchronousToAll interface is a good solution.

The question for this is that I recently used EventFlow for my project. Because the Serilog Framework provide write log to multiple places same time.

ppXD avatar Jul 14 '17 01:07 ppXD