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

Cache Integration #116

Open
pdrivom opened this issue Jun 14, 2023 · 5 comments
Open

Cache Integration #116

pdrivom opened this issue Jun 14, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@pdrivom
Copy link
Contributor

pdrivom commented Jun 14, 2023

Is your feature request related to a problem? Please describe.
For larger applications with a lot of data, caching architecture can increase greatly the performance of retrieving data.

Describe the solution you'd like
On the database query layer, first check if data exists on Redis, otherwise get on Postgres.

@seapagan seapagan self-assigned this Jun 15, 2023
@seapagan seapagan added the enhancement New feature or request label Jun 15, 2023
@seapagan
Copy link
Owner

seapagan commented Jun 15, 2023

Hi @pdrivom

Yeah, this is a good idea. I'll look at adding this when I've completed the base functionality of the template.

EDIT:
A plugin exists to do this fastapi-redis-cache so it should be reasonably straightforward. I'll look at it later. Getting my solar panels wired in today though so my 'leccy may be on and off.

@pdrivom
Copy link
Contributor Author

pdrivom commented Jun 15, 2023

Hey @seapagan, yes, should be a kinda "easy" feature to add.

Good luck with your solar panels. I'm an Electric and Computers Engineer, so I can relate how personal can get wiring tasks around the house 😃

@seapagan
Copy link
Owner

Hey @seapagan, yes, should be a kinda "easy" feature to add.

Hopefully. I've looked at the repo for that and there are a fair number of unmerged PRs to fix issues. I may end up forking that and merging them myself.

Good luck with your solar panels. I'm an Electric and Computers Engineer, so I can relate how personal can get wiring tasks around the house

Ta 😃. Sparky can't come today with the Battery sadly so it's postponed.

@seapagan
Copy link
Owner

This may get implemented earlier than planned since most of my ideas to implement rate-limiting and blocking use Redis anyway 😁. I may get this done over the weekend.

@seapagan
Copy link
Owner

Update:

I'm working on fixing and improving the fastapi-redis-cache package, which seems to have been abandoned. It has a few issues and false assumptions. There is also no way to easily expire a cache if new data is posted. Once I sort that, I'll add it to this package for caching

I prefer this package as it has a very easy caching mechanism using route decorators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants