Skip to main content

Notifications

Power Pages - General Discussions
Suggested answer

CRUD operation with webapi is slow

(2) ShareShare
ReportReport
Posted on by 18
Hello everybody,
 
the website that I'm building uses virtual tables from SQL. I use webapi to perform CRUD operations but I noticed that it's very slow. A patch operation to update a column of a row in a table can take from 6 to 16 seconds. Some pages need to load data from several tables when open, which can take very long if open for the first time. Is it supposed to take this long? Is it this slow because I use virtual tables? Is there any way to reduce the loading time?

Thanks in advance for your answers.
Categories:
  • CU31070723-0 Profile Picture
    CU31070723-0 18 on at
    CRUD operation with webapi is slow
    We abandoned the virtual SQL tables to use only Dataverse tables and it's much much quicker and simpler!
  • CU31070723-0 Profile Picture
    CU31070723-0 18 on at
    CRUD operation with webapi is slow
    Could you tell me how to batch API requests?

    I have been using api commands in this format
     
    webapi.safeAjax({
              type: "PATCH",
              url: "/_api/{table logical name}s({GUID of row})",
              contentType: "application/json",
              data: ...
    });

    I found information on this page Execute batch operations using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Learn but don't know how to write the code there in the "webapi.safeAjax({...})" format that I have been using.
  • Suggested answer
    Inogic Profile Picture
    Inogic 852 on at
    CRUD operation with webapi is slow
    Hi,
     
    When using Power Pages with the Web API to perform CRUD operations on virtual tables, the performance can indeed be slower due to the real-time nature of virtual tables and the overhead introduced by the Power Platform’s API layer.
    Below are a few steps to help reduce the load time of API events
    • Batch API Requests:
      • Group multiple API operations into a single request to reduce the number of API calls.
    • Reduce Data Fetched:
      • Use $select to return only the necessary fields and $filter to retrieve only the needed rows.
    • Caching for Read-Heavy Operations:
      • Use server-side or client-side caching to avoid frequent API calls for static data.
    • Asynchronous (Lazy) Loading:
      • Load essential data first, and fetch additional data asynchronously as needed.
    • Background Processing for Long Operations:
      • Use background jobs or Power Automate for time-consuming updates like PATCH.
    • Optimize SQL Queries:
      • Ensure efficient SQL queries by using proper indexing and avoiding complex joins.
    • Server-Side Pagination:
      • Implement pagination using $top and $skip to load data in smaller batches.
    • Monitor API Performance:
      • Use tools like Application Insights to track and analyze API performance.
    • Preload Critical Data:
      • Pre-fetch key data in the background and store it locally for faster access.
    • Optimize Power Pages Configuration:
      • Minimize unnecessary page interactions that trigger Web API calls and reduce dependencies on virtual tables.
    Hope this helps.
     
    Thanks!
    Inogic Professional Services: Power Platform/Dynamics 365 CRM
    An expert technical extension for your techno-functional business needs
    Drop an email at crm@inogic.com 
    Service: https://www.inogic.com/services/ 
    Tips and Tricks: https://www.inogic.com/blog/ 
  • Suggested answer
    FLMike Profile Picture
    FLMike 27,286 on at
    CRUD operation with webapi is slow
    There isn't any way for us to tell you.
     
    We have no access to your servers, or the networks or the gateway etc.
     
    I will see that YES virtual tables, especially if through gateways with lots of data can be slower, so you would need to enhance them to perform better
     
    If this helps please mark as yes
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,504

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,367

Leaderboard

Featured topics