I've been doing some research on multi-tenant systems and micro-services and I'm a bit confused by this.
If each micro-service has it's own database, and implements the support of multi-tenancy in it's api - what service is responsible for telling the micro-service what account Ids map to which customers?
Is there a single source of truth for the account Ids? How is this information propagated out to all the various micro-services if a new customer is added?
Initially I thought that perhaps the micro-services don't need to be aware of this at all, they just accept an account Id and store the data without caring what customer it came from. But how do you avoid the issue of duplicate/wrong/updated account Ids being sent to these services? Doesn't this seem like a big security and regulatory risk?
This isn't a problem in a single database design, because Account Id is constrained in all tables that reference it and is easier to manage.
Accounts
microservice? Wouldn't that microservice be your single source of truth? You don't have to propagate this information; it's already there for the taking. If you see an account id that you don't recognize in the foreign key of a customer record, just look it up from the Accounts microservice.