I follow clean arch / solid principles on my entire stack. I'm coming across a situation where I want to embed an UUID in some of my entity id fields in the domain logic, for example:
- Create
OrganizationEntityid=abc123 - Create a
ItemEntityand embed theOrganizationEntity's id that owns thatItemEntityin the id field when it's created, ie:Item.id = itm-abc123-sdfnj344I'm thinking of going this route so that I can reduce the amount of DB lookups to see if someone has access to aItemEntity- if the client request belongs toOrganizationEntitythen I can pattern match abc123 on both the client request session id and the requesting record forItemEntity... this would greatly improve performance.
Is this a known pattern/implementation? Are there any concerns or gotchas?