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
Proposal: the update of User lastSeenAt & lastVisitAt in auth middleware should be optimized #83
Comments
You are right. For counts in a high concurrency scenario we need a better count strategy altogether perhaps. Not directly on the user perhaps. This is an almost universal challenge, so I am sure that there exist smart solutions to have scalable counts that are almost realtime or eventually consistent? Perhaps an open source event analytics library can help cella to also maintain county like these? For example, I am following this repo: https://github.com/Openpanel-dev/openpanel . What do you think? |
benefit of such a strategy is that it can help with both app-level reporting as well as customer/tenant-level and perhaps product/project level reporting, ideally all from within the app/cella itself. cc @yunge |
It's nice to have a more professional service, but I'd recommend keeping a basic functionality based on our own DB server. After all, not everyone needs a professional service(such as in-house systems). In addition, Openpanel’s GPL license may also cause some troubles. |
In auth middleware, the update of User lastSeenAt & lastVisitAt is too frequent, it's better to "update after a certain amount of time past the old timestamp".
Unnecessary updates can affect postgres performance and generate unnecessary WAL logs.
And the code is in "backend/src/middlewares/guard/auth.ts", thanks.
The text was updated successfully, but these errors were encountered: