best approch for filtering

I have a list of entities (profiles)
I have another list of entities (openapis)

each openapi can be pointed at by several profiles

ex: openapis: “Alpha”, “Beta”

profiles: profile1 > “Alpha” profile2 > “Alpha” profile3 > “Beta”

I need to display list of openapis [“Alpha”, “Beta”] and their pointing profile
ex:

“Alpha” : profile1 ,profile2

“Beta”: profile3

I dont have database Im using “kebernetes” CRs what is the best approch for this ?
I know I can just filter profiles for each openapi but is there a better approch ?