What if the caching of permission system and user group system is very complicated?

for example, in a user group, a user can belong to multiple groups, and multiple users in a group need to do bidirectional caching because they need to obtain groupSet:getByUserId:xxx userSet:getByGroupId:xxx in both directions

then role, permission roleSet:getByUserId:xxx

when you create a new group, you have to initialize a lot of things, such as permissions, team members, etc., into the cache, which leads to a lot of distributed transactions (database rollback, cache does not roll), and distributed transactions have consistency problems, and then it becomes very complex

what should I do with this?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e90ae3-12f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e90ae3-12f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?