I am writing an application that handles organization members and payments. I have the following entities:
Organization---+
|
+---Members-----+
| |
| +---Children
+---Accounts
|
+---Payments
There can be >100,000 payment per organization, but only few members and Accounts. When a member is logged-in he can see only his payments. When admin is logged in he should be able to access all data.
The questions are:
- Should I keep hierarchical structure of the organization or should I flatten each entity?
- In case I would like to keep the structure hierarchical, is it possible to get an Organization with only partial sub-collections (not all members and not all payments)
Thanks.