Skip to content

Different MsSql Database for Read Models and Events #417

Closed

Description

@dotfelixb

Any implementation of how to use a different database MsSql Database for events and another for read moeel, command/query segregation

Activity

  1. rasmus commented on Jan 7, 2018

    @rasmus
    Member

    It isn't possible to do easy. You'll have to do some IoC configuration to pass a different instance of the MSSQL connection to read model updaters and readers.

  2. Yaevh commented on Jun 16, 2021

    @Yaevh
    Contributor

    This limitation stems from the fact that the database is configured globally and not per UseEventStore()/UseReadModelStore() call. And to say frankly it's kinda pain in the butt.

    Currently IMsSqlConnection, IMsSqlConnectionFactory etc. are registered directly in the container using ConfigureMsSql(). Instead, UseMssqlEventStore() (or maybe an overload of that method?) should accept IMsSqlConfiguration directly and use that IMsSqlConfiguration to instantiate MsSqlEventPersistence itself, instead of MsSqlEventPersistence using container to request IMsSqlConnection. The same goes for UseMssqlReadModel().

    If I find the time, I'll try to put together something like this next week.

    BTW, the same problem occurs in SQLite and probably other DB providers.

  3. rasmus commented on Jun 17, 2021

    @rasmus
    Member

    Something that needs to be investigated for 1.0 for certain

  4. added this to the milestone on Jun 17, 2021
  5. rasmus commented on Mar 3, 2022

    @rasmus
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions