-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Came from:
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.
As suggested by @prooph and @gquemener for SQL projections:
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.

