Giter Club home page Giter Club logo

Comments (2)

George-Miao avatar George-Miao commented on June 26, 2024 1

Update: This is no longer needed. According to benchmark, time consumption of the MongoDB fetch that does this is in an acceptable range for K < 300,000, where K is len(entities) * len(kinds) * len(users). In prodution we can also introduce a cache.


In order for the API and bots to distribute updates to corresponding subscribers, we will need an index. Currently, there's a type in the core submodule called EventFilter, which represents a user configuration about what they are interested in, thus what events they will be receiving. And that implies a mapping relationship from User to Events. However, with updates that are a stream of Events from MQ, this mapping relationship can bring a time complexity of O(u) on every update, where u is the number of users.

Thus, we shall introduce a new design, Index, where the relationship is {[Event] -> User[]}, derived from the existing event filter, which will be stored as user configuration. We can utilize multimap to accomplish this. Re-indexing is needed once in a while for this design and brings the drawback of delaying the user's update.

@PhotonQuantum any thoughts?

from stargazer-reborn.

George-Miao avatar George-Miao commented on June 26, 2024

After discussion, our design decision is that:

  • Bots will receive events from RabbitMQ
  • Bots will interact with API, not DB.
  • Therefore, an API client library is required.

Looks good? @PhotonQuantum

from stargazer-reborn.

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.