You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently assume the user mapping process is a relatively cheap process that can be executed often and does not have a noticeable performance impact.
This assumption is invalid and should be fixed by not re-exuting the user mapping process for user data as long as that user data is valid.
Concrete Example
This is especially relevant because user mapping is executed via our REST integration on every request. If for example a mapping implementation involves creating groups and synchronizing membership information this might result in some database queries which then result in noticeable delay on every API request.
Solution Idea
If I'm not mistaken all user data types provide some sort of expiration mechanism.
This means that we could use the django caching framework inside UserMapper.handle_federated_userinfo() to determine whether it should call down to the actual mapping method or return a user instance from cache (well, the ID would be cached and the user would be fetched from DB but you know what I mean).
As a similar alternative, we could introduce a caching wrapper to UserMapper.handle_federated_userinfo() which would work the same way as described above but if action needs to be taken, calls into handle_federated_userinfo(). This approach would make it easier to keep using handle_federated_userinfo() as an extension point because not a lot of functionality would need to be implemented.
The text was updated successfully, but these errors were encountered:
We currently assume the user mapping process is a relatively cheap process that can be executed often and does not have a noticeable performance impact.
This assumption is invalid and should be fixed by not re-exuting the user mapping process for user data as long as that user data is valid.
Concrete Example
This is especially relevant because user mapping is executed via our REST integration on every request. If for example a mapping implementation involves creating groups and synchronizing membership information this might result in some database queries which then result in noticeable delay on every API request.
Solution Idea
If I'm not mistaken all user data types provide some sort of expiration mechanism.
This means that we could use the django caching framework inside
UserMapper.handle_federated_userinfo()
to determine whether it should call down to the actual mapping method or return a user instance from cache (well, the ID would be cached and the user would be fetched from DB but you know what I mean).As a similar alternative, we could introduce a caching wrapper to
UserMapper.handle_federated_userinfo()
which would work the same way as described above but if action needs to be taken, calls intohandle_federated_userinfo()
. This approach would make it easier to keep usinghandle_federated_userinfo()
as an extension point because not a lot of functionality would need to be implemented.The text was updated successfully, but these errors were encountered: