Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2019/06/19/cqrs-symfony-elasticsearch-react #5

Open
romaricdrigon opened this issue Jun 19, 2019 · 4 comments
Open

2019/06/19/cqrs-symfony-elasticsearch-react #5

romaricdrigon opened this issue Jun 19, 2019 · 4 comments

Comments

@romaricdrigon
Copy link
Owner

Please comment below!
Comments will automatically be published on the blog, too.

@Gompali
Copy link

Gompali commented Aug 12, 2019

Hi, interesting article, pointing out implementation of CQRS. How the "write" database can publish to the "read" database ? Do you have an example ?

@romaricdrigon
Copy link
Owner Author

You want to use a bus, and technically a message queue makes more sense: having an asynchronous transport allows to lighten the load on the write database.
I don't have personal examples, but you find plenty around. Someone implemented it with Tactician, and I'm sure you could do the same with Symfony Messenger.

@Gompali
Copy link

Gompali commented Aug 13, 2019

Yes, I'm ok with messenger. In terms of design, am I right that :

CommandBus -> Create entity in SQL
EventBus -> Sends "EntityCreated" to event handler that should feed let say a MongoDB
QueryBus -> Sends queries to MongoDB

I'm looking for event handling patterns to implement properly and without vendors ;-)

@romaricdrigon
Copy link
Owner Author

It sounds correct, theory-wise.
In practice, I'm not sure you really need 3 buses. I would use Doctrine listeners instead of a CommandBus in most cases, and QueryBus is not quite something "physically". You just query MongoDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants