Alex Rivera | Logout

CQRS: Synchronizing the Write and Read databases

Asked 2010-07-13T07:02:45.620
16

Can anyone please give me some direction in regards to various ways to synchronize the Write and Read databases?

What are different technologies out there, and how do you evaluate each, in terms of realiability, performance, cost to implement, etc.

Edit
Report

1 Answer

1

If you, like me see the read store as the db that the Query service use (and its denormalized) and the write db as the database where the Domain events are stored , then if you need to Synch them to a particular moment then what you can do is just replay the events that you have stored. In the case you want to be as up to date as possible then you need not to restrict by version

If you are using CQRS, then probably you will have a repository that looks somewhat like this

    public interface IRepository<T> where T : AggregateRoot, new()
    {
        void Save(AggregateRoot aggregate, int expectedVersion);
        T GetById(Guid id);
        T GetById(Guid id, int version);
    }

Hope this helps Cheers

answered 2010-10-18T16:36:07.953

Your Answer