Comments (2)
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 Event
s. However, with updates that are a stream of Event
s 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.
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)
- Switch to stable Rust HOT 2
- Switch to stable MongoDB crate HOT 2
- Twitter worker HOT 1
- Bilibili worker for `Dynamic` update
- Youtube worker
- Bililive worker for streaming and other events
- Workers
- API HOT 3
- Switch from bincode to json HOT 3
- Coordinator panic in certain conditions
- Anyway to distinguish `User` from a person in group and a private chat? HOT 2
- API design HOT 2
- Middleware design HOT 2
- Task misscheduling when a worker restarts quickly
- Inconsistency of `uuid::Uuid` and `bson::Uuid` HOT 2
- MongoDB cannot deserialize `Entity` correctly HOT 8
- Telegram Bot
- Authentication HOT 6
- Typo in doc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stargazer-reborn.