Multiple unique single indexes in sharded collections
MongoDB sharded collection can only have one unique index which is the shard key. However, in real applications, one might need more than one single unique index. "Proxy" collections suggested in https://www.mongodb.com/docs/manual/tutorial/unique-constraints-on-arbitrary-fields/ has 3 issues:
The most important one is that it does not enforce a one-to-one relationship between the main document and the proxy document. So if I follow the example in the link, two different emails can have the same parentid. You can add a unique single index on parentid but that will not work if the proxy collection is sharded.
If I want to add data atomically to both the the main collection and the proxy collection I need to create a transaction. From what I understand, transactions across collections (especially sharded collections) causes performance issues. For example, suppose I want to create a new user in the main collection, I need to add the user's data in the main collection and add the user's email in the proxy collection in one transaction. However, if MongoDB allows multiple unique indexes in sharded collection, then there won't be any need for transactions.
Increased $lookup use when retrieving the data.
I understand that typically horizontally scalable databases do not have more than one unique index. There are a few exceptions though such as Google Spanner so maybe you can look into how they implemented it (https://cloud.google.com/spanner/docs/secondary-indexes#unique-indexes)?