Git Product home page Git Product logo

Comments (4)

abumq avatar abumq commented on July 23, 2024

This is going to be a little tricky for few reasons

  1. Trends update every 30 minutes or so
  2. Search result is generated purely from the search index and search service which deliberately does not talk to hadith service or analytics service to speed up the search process, so we have no way of knowing whether hadith is trending or not.

For above reasons, we would most likely need to add a separate Elasticsearch index update job for this (not a good idea though).

from planner.

abumq avatar abumq commented on July 23, 2024

I think a better solution would be to add another job who's sole purpose would be to update the ahādīth records that are now trending and that are no longer trending
That way the Elasticsearch builder would pick up these records, and update their associated index.

Doing this would also mean we can continue to use search service as it is and pick up the record right from the ES

The downside is cache invalidation but there is also a workaround for that which is search versioning. This would be a little cumbersome especially because our trends change every 30 minute.

from planner.

abumq avatar abumq commented on July 23, 2024

Another possible (and simpler) solution is asynchronously fetch the badges post search - there is going to be a slight user experience concern here.

from planner.

abumq avatar abumq commented on July 23, 2024

So we have 3 possible solution to achieve this:

  1. New job that would find trends and update the search index (worst option)
  2. New job to update the records with new trend and remove old trends and so existing ES job can pick up these records and update the index
    • +simple solution that works with existing eco-system
    • -ddl change for hadith
    • -frequent hadith records update
    • -cache invalidation
  3. Asynchronously fetch the badges from hadith service.
    • +simple solution
    • -bad user experience
    • >going to need new GET API

from planner.

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.