We have situation where we have hierarchical data like regions and countries with the regions. For instance APAC contains Asia which contains South East Asia which contains India, Sri Lanka, Bangladesh etc. User has a choice to select either APAC or Asia or South East Asia or all or few countries in South East Asia. Now say we have a document for person entity with location country India, we have two ways to store data -
- We can store all the possible regions India falls under as array of regions - APAC, Asia, South East Asia to allow it getting searched directly by user provided region?
- We only store immediate region South East Asia and then when user selects APAC we translate it into all possible child regions - South East Asia, North East Asia, Central Asia etc to allow search.
Which approach sounds better?