-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduler and worker #24
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adzialocha
previously approved these changes
Oct 20, 2020
adzialocha
force-pushed
the
logging
branch
2 times, most recently
from
October 26, 2020 11:04
420e426
to
2eda7bc
Compare
This was
linked to
issues
Nov 16, 2020
adzialocha
added
enhancement 🎇
New feature or request
refactor 🐝
Existing parts made better
labels
Dec 9, 2020
6 tasks
This was referenced Feb 4, 2021
9 tasks
adzialocha
approved these changes
Mar 5, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎆 🎆 🎆 🎆 🎆 🎆
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves one of the largest bottlenecks in circles-api which is the indexing of trust connections (ca. 800k currently) between users.
Currently we pull the trust network data from our graph node, store it in a separate PostgreSQL database for faster querying and run the transfer path algorithm against this. The problem here is that we unnecessarily download all data, even of trust connections which haven't been updated at all. This puts unnecessary pressure on both the graph node, our database and the api process besides taking a large amount of time.
The solution to this problem is to listen to Ethereum events directly instead of relying only on the graph node and accordingly add / update / delete trust connections in the PostgreSQL database depending on the event.
To help with this a specificiation has been prepared, and is added in the PR
Additionally we put these updates into a worker queue to have more control over how much work the machine is actually doing and export a daily json file of the current trust network on S3 for external use.
Todos:
main