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

fix: count events instead of loading them in memory #3382

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

FredrikOseberg
Copy link
Contributor

Refactor project events to use count instead of loading the events in memory

@vercel
Copy link

vercel bot commented Mar 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 24, 2023 at 2:03PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
unleash-docs ⬜️ Ignored (Inspect) Mar 24, 2023 at 2:03PM (UTC)

@github-actions
Copy link

After enabling strictNullChecks this PR would be increasing the number of null check errors from 410 to 411.
Make sure your branch is up-to-date with main and check the diff in the console output to pinpoint the offending files.

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pair programmed. eventually we'll move parts of the store to a dedicated read model

}),
);
await Promise.all(
statusUpdates.map((statusUpdate) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many queries can we potentially generate here?

}
schedulerService.schedule(
projectService.statusJob.bind(projectService),
hoursToMilliseconds(24),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this every 24th hour can be a scary thing, depending on the cost of this query. What happens when a customer have hundreds of projects and a lot of events?
Would love to see some data on the query cost for different setups.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we'll provide a breakdown of the different test cases including the memory footprint in a follow up PR.

@FredrikOseberg FredrikOseberg merged commit 354e54a into main Mar 27, 2023
@FredrikOseberg FredrikOseberg deleted the fix/events-in-memory branch March 27, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants