Hi,
I’ve recently started working on a side project of mine. It involves having two separate types of users, Suppliers and Customers.
They need different sets of data to be stored, specifically Suppliers which have subscription / payment information stored. They also need to go through different sign-up flows in order to input said data.
I’m looking at the following options:
- Put all the extra data in the user profile, while adding an extra param, say “profile.type” to be either “supplier” or “customer”. But i think you shouldn’t put anything in the profile that you wouldn’t want the user editing.
- Having separate collections, while referencing them by userId. But doesn’t this decouple data which is logically coupled, as well as introduce an unnecessary “join” in the code?
How is it best to design the data given these constraints? Your help is much appreciated.
Thanks,
Bogdan