Caching layer implementation around driver calls.
There should be a configurable caching layer that lives above the various driver calls within Keystone. This should be configurable (using something akin to dogpile.cache) to allow for varying caching backends (in-memory, file-based, redis, memcache, etc) to alleviate load on the backend storage/mechanism for the differing aspects of keystone.
This system will encompass the feature(s) of https:/
In absence of explicit configuration of a caching back-end, the behavior will remain the same as current with no-cache.
Key things to keep in mind are: cache invalidation, ensuring the configuration for keystone is extended to expose a reasonable featureset of the caching layer.
It will be on the developer to ensure that the decorator is added to new methods (as needed) and invalidation will be handled in a consistent manner. The cache interface within keystone will provide a way to be consistent with the implementation of the cache across the different drivers and subsystems within keystone.
The initial discussions via IRC was to provide access to a series of decorators that will decorate the various driver calls, allowing for caching-in-line (via dogpile.
An example implementation is outlined: https:/
In conjunction with this, caching layer, normalization of the use of kwargs when calling manager methods needs to be completed. The main issue with kwargs, is that the dogpile.cache only supports the use of args (not kwargs) with the default key-generator. If we provide a new generator that can support kwargs, there is a lot more work to ensure that the invalidate() calls (when required) will produce expected results since the arguments will need to generate the same key in the cache. The extra level of introspection of the actual function needed to ensure consistency with kwargs support seems like it could have adverse side-effects, performance-impact, and possibly make the code much harder to maintain/follow.
The kwargs change has the added benefit of making the drivers/managers where kwargs are used more consistent with the rest of keystone (In some cases, notably token drivers/providers, there are extensive uses of kwargs to methods).
Blueprint information
- Status:
- Complete
- Approver:
- Adam Young
- Priority:
- Medium
- Drafter:
- Morgan Fainberg
- Direction:
- Approved
- Assignee:
- Morgan Fainberg
- Definition:
- Drafting
- Series goal:
- Accepted for havana
- Implementation:
- Implemented
- Milestone target:
- 2013.2
- Started by
- Thierry Carrez
- Completed by
- Dolph Mathews
Related branches
Related bugs
Sprints
Whiteboard
morganfainberg:
In conjunction (as a separate review) I am proposing that we also cleanup the token providers to remove the single "issue_token" interface with the kwarg that specifies the version of token to be issued. It would be easier to follow if we simply provided an interface per version to issue tokens.
I am proposing deprecating the <provider>
---------
Gerrit topic: https:/
Addressed by: https:/
Remove kwargs from manager calls where not needed.
Addressed by: https:/
Refactor Token Providers for better version interfaces
Addressed by: https:/
Keystone Caching Layer for Manager Calls
Addressed by: https:/
Remove kwargs from manager calls where not needed.
Addressed by: https:/
Implement caching for Tokens
Addressed by: https:/
Implement Caching for Token Revocation List (merged)
Addressed by: https:/
Refactor Token Provider to be aware of expired tokens. (merged)
Addressed by: https:/
Implement basic caching around assignment CRUD
Addressed by: https:/
Add Memory Isolating Cache Proxy
Addressed by: https:/
Cleanup cache layer tests