Replies: 1 comment 1 reply
-
To all your questions one after another 😅 JSON columns slow: Needed in the package: Over engineering: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem Statement
This is more of a question (for now) than a feature request as I know that what i need can already be "massaged" into activitylog, but I'm concerned about the overall performance of queries
Background
Logs are ultimately "sentences" and in a multi-tenant app, you always have the following componets of a sentence:
In my app, a Tenant must be able to review any log item in which they are the Context, Subject or Object.
Now, all of this is possible with the current activitylog implementation but using "properties" for the object and by de-normalizing the log_name (to include my "context" inside of it).
For instance, I can use:
My concern is searching performance as a json column is arguable the slowest datatype there is for querying, across millions of records.
So my idea is to extend activitylog to add the following columns:
And then I could use the log_name for the "domain" (aka - feature of the app: security, permissions, etc, etc, etc, etc)
This would make querying/filtering the audit log fast with the ORM equivalent query being:
I guess my question is, am I over-architecting this or would others find this valuable too if I were to implement it? And is there a better way to do this rather than extending the code (I have looked and I don't see any, but activitylog will be very easy to extend to manage this).
Example Logs:
Beta Was this translation helpful? Give feedback.
All reactions