Multible ID's for the same aggregate

Can I use projections to map one aggregate stream to multible ID’s representing the same object?

We are rewriting an application using EventStore and need to keep original, external and internal ID’s for the same business objects.
We receive data from external sources that references e.g. customer #1001 which needs to be mapped to the internal GUID that we use for our aggregates.

Once mapped the user need to be able to search a customer by the original migrated database id 50007 which he/she has learned to use.

We want to use GUID’s for our internal aggregate ID’s to avoid a central store for creating unique ID’s.

So do I use projections to map one aggregate stream to multiple ID’s and thereby avoid a look-up-database?

This would give us Customer_GUID = Customer_EX_ID = Customer_MigratedI_D and we can load an aggregate without first having to look up the internal GUID from a database tabel.

We have a lot of customer objects so performance is an issue.

/Thomas

Hello Thomas,

you could use the „link to“ feature of eventstore to write a new stream of events that are only links to the original event.

An example was given the the „process manager“ mail thread some days ago.

The other option is to generate a deterministic GUID. Example: https://gist.github.com/dnauck/6190ac506b05691cc29d

But question is: do you really need to read/write streams by old and new ids? „Searching" sound like stuff that is done in the read model. If not you could add the old id into the events metadata or payload.

Hope that helps.

Daniel

Thank you for the answer.
Adding the old id in the event metadata or payload sounds like a good idea.