Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce database driver support for caching. #852

Open
jameskirtland3 opened this issue Apr 26, 2022 · 3 comments
Open

Introduce database driver support for caching. #852

jameskirtland3 opened this issue Apr 26, 2022 · 3 comments
Labels
feature New feature or request v4

Comments

@jameskirtland3
Copy link

jameskirtland3 commented Apr 26, 2022

Description

The project should support the database driver as a caching option. The CacheManager forces the use of tags, making the database driver untenable. Instead, as an option, the CacheManager should use the tenant-initialized DB connections instead of relying on tags to separate cached data.

Why this should be added

Given the utility of the database driver for clean session scoping, the caching implementation for this project seems unusually database-averse. I realize it isn't the optimal driver for many caching processes, but it seems in line with the overall intention of the project.

In a database implementation, the use of tags would be unnecessary (since the cache table could be created in each tenant). Access to the data would be separated by tenant. Resources consumed for cache maintenance would be separated by tenant.

In struggling to get other caching implementations to work for my project, I assumed (incorrectly) I could default to the database driver.

@jameskirtland3 jameskirtland3 added the feature New feature or request label Apr 26, 2022
@stancl
Copy link
Member

stancl commented Apr 26, 2022

Is this covered by #531?

@jameskirtland3
Copy link
Author

Partially- #531 does recognize the limitations. Shouldn't a database caching implementation use the tenant DB instead of central, though?

@stancl
Copy link
Member

stancl commented Apr 27, 2022

Hmm that's a fair point, prefixes would make sense with drivers that use a central storage.

Having the cache inside tenant DBs is something I'd need to test though since I think the cache is sometimes used before tenancy is initialized in the request lifecycle, which could make it difficult to grab the cache values from the right DB.

That said, in v4 the request lifecycle will change as well, so I'll tag this as v4 and consider it while working on it 👍🏻

@stancl stancl added the v4 label Apr 27, 2022
@stancl stancl removed their assignment Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request v4
Projects
None yet
Development

No branches or pull requests

2 participants