Skip to content

Use Redis as storage backend instead of database #20

@alextreme

Description

@alextreme

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions