feat: Optimize finding newer active deployments for device using MongoDB Aggregation
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
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.
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]>
Cheers!
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.
Closing as this PR went stale and it is now superseded by #1026