Skip to content
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

Optimization of database writes #85

Open
sondreb opened this issue Feb 12, 2023 · 1 comment
Open

Optimization of database writes #85

sondreb opened this issue Feb 12, 2023 · 1 comment

Comments

@sondreb
Copy link
Member

sondreb commented Feb 12, 2023

When Notes receive a lot of the same events, there is a race-condition on get and puts resulting in multiple puts happening because the async await is waiting while next event triggers.

This could be optimized potentially with an queue for writes, where events fill up a queue instead of writing directly as now. The queue could also potentially look for duplicates directly when inserting into the update queues.

Example code where put of contacts and profile happens multiple times, depending on number of relays:

image

@sondreb
Copy link
Member Author

sondreb commented Feb 13, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant