deployments icon indicating copy to clipboard operation
deployments copied to clipboard

feat: Optimize finding newer active deployments for device using MongoDB Aggregation

Open BenMeehan opened this issue 2 years ago • 3 comments

Optimize finding newer active deployments for device using MongoDB aggregation

Noticed a lot of data egress when a device checks for an update, especially if the deployment size is large.

This commit optimizes a database query using the MongoDB aggregation framework to improve performance and reduce resource usage and network data transfer. The changes include a more efficient aggregation pipeline to fetch data, resulting in faster query execution and less data transferred overall.

Changelog: All Ticket: None

BenMeehan avatar Sep 21 '23 14:09 BenMeehan

Merging these commits will result in the following changelog entries:

Changelogs

deployments (optimize-find-active-deployments-using-aggregation)

New changes in deployments since master:

Features
  • Optimize finding newer active deployments for device using MongoDB aggregation

    This commit optimizes a database query using the MongoDB aggregation framework to improve performance and reduce resource usage and network data transfer. The changes include a more efficient aggregation pipeline to fetch data, resulting in faster query execution and less data transferred overall.

mender-test-bot avatar Sep 21 '23 14:09 mender-test-bot

Ohh, and one more thing! We use semantic commits to track and group changelogs, so could you please also update the commit message to use the perf scope, and maybe adjust the message a little?

Suggestion
perf: Optimize query for finding next deployment for device
This commit optimizes a database query for getting the next deployment for a device to improve performance and reduce resource usage and network traffic. The change replaces scanning for the next deployment with a single document query that gets the next deployment directly.
Changelog: Title Ticket: None Signed-off-by: Ben Meehan &[email protected]&gt

Cheers!

alfrunes avatar Oct 04 '23 13:10 alfrunes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 15 '23 08:12 stale[bot]

Closing as this PR went stale and it is now superseded by #1026

alfrunes avatar Jun 11 '24 13:06 alfrunes