appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

chore: introduce caching and projection to optimise FPL

Open subrata71 opened this issue 5 months ago • 6 comments

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 optimizing appsmith.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-consuming getpage 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:

Screenshot 2024-09-04 at 6 57 01 PM Screenshot 2024-09-04 at 6 57 46 PM Screenshot 2024-09-04 at 7 03 17 PM Screenshot 2024-09-04 at 7 12 47 PM

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:

  1. cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js
  2. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  3. cypress/e2e/Regression/ClientSide/Widgets/Button/Button_spec.js
  4. cypress/e2e/Regression/ClientSide/Widgets/Container_spec.js
  5. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Button_Icon_validation_spec.js
  6. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Color_spec.js
  7. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Add_button_spec.js
  8. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js
  9. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Color_spec.js
  10. cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts
List of identified flaky tests.
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.

subrata71 avatar Sep 04 '24 11:09 subrata71