Code Monkey home page Code Monkey logo

Comments (1)

triat avatar triat commented on September 17, 2024

Hello @amankumarjain,
That's actually a really nice question that I tried to solve some times ago. My conclusion was:

  1. Using celery is not really a solution (at least for me as we are using SQS as a queue system) because response time of the DB ~= response time of SQS. So not a solution
  2. Async python3 could be a way to do it, for I don't remember which reason, we could consider this solution so I don't know
  3. "Send a request to add data and do not wait for the answer" was our best solution. What it means is you do your call to what ever system is saving your data but you don't wait the answer or there is no answer. By doing that you avoid every latency or service unavailable disruption. The bad point of this solution is that you could potentially lose data, or at least, not register them and don't know about it.

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)

from drf-tracking.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.