Verify Unique Investors
I love event sourcing and I’m really digging the event store. Where it does pose a bit more of a challenge over an RDBMS is when trying to solve a unique constraint. Specifically when you are trying to create a unique identifier for an Investor (in our current business case). You could create a stream naming pattern that uses email address. For example [email protected] and then when a new Investor account is created you check for the no_stream expectedRevision so you will get an error if it exists. I don’t want to use email address as email addresses can change and I sometimes find it convenient to have multiple system accounts linked to the same email address. I see two options. 1) Create a unique uuid for each account. On account creation create a stream with the uuid e.g. user_