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

Use Redis as storage backend instead of database #20

Open
alextreme opened this issue Aug 7, 2023 · 0 comments
Open

Use Redis as storage backend instead of database #20

alextreme opened this issue Aug 7, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@alextreme
Copy link
Member

As discussed with Sergei, using Redis (or the Django cache backend) for storing the log-outgoing-requests OutgoingRequestsLog model-data would have a number of advantages:

  • We could add a TTL, that the data would automatically expire
  • We avoid a database call to Postgres when storing data
  • We avoid having to deal with transactions when an exception is raised
  • Clearing the cache means clearing out the requests/responses logs.

I've thought a bit about this as it sounds good, but there are a few drawbacks in my eyes:

  • We won't be able to use FKs/M2Ms in the future (that's not currently implemented or expected, but knowing timelinelogger it may be useful to be able to link requests to a User in the future -> then again this could also be done by storing a username)
  • We won't be able to make use of database validation? -> we can reuse validators already in Django for the specified fields
  • We won't be able to make use of the Django admin interface for looking through the data (especially the search and filters is proving useful) -> this would be a non-significant amount of code & work to create a workable interface. Third-party Django redis-admin packages are more low-level and don't seem like interfaces I'd want to show to an admin. But it could be that I overlooked something useful.

Afaik it's also not possible to use Redis as a ORM storage backend... although it would be interesting to see what's possible I'd prefer not to do anything too hacky with a shared library.

@sergei-maertens sergei-maertens added the enhancement New feature or request label Sep 22, 2023
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