Open amankumarjain opened 6 years ago
Hello @amankumarjain, That's actually a really nice question that I tried to solve some times ago. My conclusion was:
Actually the solution we went for, with a nice scaling possibility, is the Elasticsearch integration. We have an ES cluster hosted on Elastic cloud and we are sending our data directly to ES. An improvement to do is the 3rd point that I told you before, to send without waiting for the answer.
So I don't think there is an easy or awesome solution but there is definitively things to try. Aside all the possibilities, I think that DRF is trying to keep the impact on the API very low. If I'm not mistaken, our tests are checking that we don't take more than 20ms to log something (which is not perfect but it's ok-ish)
is it possible to write log with async tasking i dont want my view thread to get blocked with drf tracking operation or to write in db. I am using celery for async task.