You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a current example where we need to get guest data from a different stream before we insert a related (guestId) visit data - promoting the unique ID - at all.
What are the options beside event enriching? Separate repository calls sound like a bad idea.
Instead of storing guest data in projection state, write it to a table that is only used by the projection.
IIUC, you could store your guest data (guestId, postalCode, ...) in a separate table and make a classic inner join when querying your "audience" table (as you have the guestId when inserting into this table, you can reference it).
You may even use your existing read model class, with specialized methods (eg. insertAudience, insertGuest, ...). There's no need to make a separate read model for the guest table, IMO. Only advice would be to limit join within the read model (as in a single-table read model).
I will post two possible solutions for this in Prooph soon.
Activity
webdevilopers commentedon Aug 10, 2021
Solution 1: A single Manager and Read Model for Projection "audience"
Both tables are managed by a single read model.
Solution 2: A single Manager and separate Read Models for Projection "audience"
Which one would you prefer @codeliner @prolic?
prolic commentedon Aug 12, 2021
I have projectors per use case, not per table. It could be however, that your use case involves one projector per table.