Skip to content

Request support for multiple (bounded) contexts #660

@mahono

Description

@mahono

Hi guys,

first of all: I am happy that I clicked the link to your library in one of the recent Symfony blog posts. You did a great job here! I'm looking for an event sourcing solution with Symfony since ages now. And for the first time, this seems to be something that could fit my needs. Nice and fresh developer experience. I really like it. I love UUIDv7 and PostgreSQL. So I'm looking forward to testing your library in the upcoming weeks.

I noticed that you dropped support for "one table per aggregate type". I understand that this makes things complicated. I also found the ticket where you explained the reasons. But I have one concern here:

I am using a "modular monolith" approach where I separate the features of a Symfony project into multiple modules. A little bit similar like it was at the beginning of Symfony 2/3, when you had to implement everything in a bundle. I am also using bundles to separate code into modules with a layered architecture proposed by Matthias Noback in his nice Web Application Architecture book that nicely explains this kind of programming that nicely fits with DDD.

So my question basically is: Would it be possible to support multiple "contexts"?

What I mean is basically fully isolate everything and allow the event sourcing to run multiple instances in a project.

I don't need to have tables per aggregate type. But I would really appreciate having dedicated tables per bounded context.

I had a look at your event sourcing bundle documentation and it seems there is only one single connection? I would like to be able to somehow configure multiple instances/connections of the event sorcing, one for each context (module/bundle), and then either in the config tell the system where the matching aggregates/events/subscriber/whatever are, or have a way to configure this with Attributes.

It would be totally fine for me and even a good thing in my opinion, if each "context" would be isolated with dedicated tables for events and subscriptions. Somehow a way to basically prefix an instance of "event-sourcing" with a context name.

I think this would be a nice compromise and allow the library to be used with bigger projects without adding too much complexity.

I am not sure if this request belongs to the library or the bundle. I did not read each and every file, yet. ;o)
But I can imagine that it would need changes in both packages.

What do you think about this idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions