appsmith
appsmith copied to clipboard
chore: introduce caching and projection to optimise FPL
Description
This PR aims to enhance the performance of the pages span in consolidated-API view mode. It does so by brining the following changes
-
Add Projection: Implement projections to enhance performance for
appsmith.consolidated-api.view.pages.getpage
. -
Implement Caching: Introduce caching to eliminate the
getpage
query, thereby optimizingappsmith.consolidated-api.view.application_id
and related spans.We will implement caching to store
defaultApplicationId
information in memory. This cache will reduce the need for the time-consuminggetpage
query. On a cache miss, the system will first fetch the page and then the branched application. If the information is present in the cache, it will directly retrieve the branched application, leveraging the cached data for improved efficiency.
With these changes, the pages API is showing improvements. A few screenshots from local environment:
Fixes https://github.com/appsmithorg/appsmith/issues/36102
Automation
/ok-to-test tags="@tag.All"
:mag: Cypress test results
[!CAUTION] 🔴 🔴 🔴 Some tests have failed. Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10737494541 Commit: 08b9ffcc375739aa09dd493c2c095c0997e94ff9 Cypress dashboard. Tags: @tag.All Spec: The following are new failures, please fix them before merging the PR:
List of identified flaky tests.
- cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js
- cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/Button/Button_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/Container_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Button_Icon_validation_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Color_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Add_button_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js
- cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Color_spec.js
- cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts
Fri, 06 Sep 2024 12:22:10 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
Summary by CodeRabbit
Summary by CodeRabbit
-
New Features
- Enhanced page retrieval capabilities with additional parameters for improved data handling.
- Introduced caching mechanism for optimized retrieval of application IDs in view mode.
- Added new span constants for improved observability related to application operations in Redis.
-
Bug Fixes
- Adjusted method signatures in tests to align with updated service methods, ensuring proper functionality.
-
Documentation
- Updated test cases to reflect changes in method parameters for clarity and accuracy.
-
Chores
- Refactored method calls across various services and tests to incorporate new parameters and improve overall performance.