Separate tables or just one table to hold access control info between entities?
Senior, Junior_A, Junior_B, AccessControl
where `AccessControl` holds access control details between all the entities. This simplifies the code but could lead to performance issues as everything is put into one table.But, then I can also create the tables as follows:
Senior, Junior_A, Junior_B, AC_Senior_Senior, AC_Senior_Junior_A, AC_Senior_Junior_B, AC_Junior_A_Junior_A, AC_Junior_A_Junior_B, AC_Junior_B_Junior_B
where `AC_ABC_XYZ` is a table that holds access control information between entities `ABC` and `XYZ`. This complicates the code as the code now has to handle different tables depending on the entity types involved, but will improve performance.
Which design would you prefer, and why?