This blog post provides guidance to architects, developers, and administrators in creating and designing Lightning pages that scale and perform well. Where we used to have Visualforce and multi-page applications, we now have Lightning Web Components (LWC) and single-page applications (SPA).
Salesforce online training With SPA, a user can do most of the work from the same page without navigating to other pages. This is a huge productivity gain and can result in great user experience; however, proper design is recommended to ensure large volumes of requests do not pose any scale or performance challenges.
SPAs are made up of components that receive and send data to the server using XML HTTP Requests (XHR).
When a page loads, components can be rendered in parallel, making multiple XHRs to the server in order to retrieve data and metadata.
In implementations with a large user base using the Lightning application concurrently, the component architecture can create a great number of network requests in the Org. Proper design is recommended to ensure large volumes of requests do not pose any scale or performance challenges.
A Word about Scale and Performance
Scaling is the ability of a system to perform consistently under load. Lack of ability to scale can impact all processes in a system and can impact business growth. Performance is the time taken for a request to complete. Your user experience can be negatively impacted by UI applications that don’t perform well.
Factors that Impact Lightning scale
In implementations with a large user base, there are certain aspects of page design that can be optimized to scale. A few are summarized here:
- Number of visible components on page load
- Custom list views with lots of data
- Related Lists, Quick Links
- Custom Components
- APEX & backend
- UI Forms
Below you will find recommendations for each of these page design ideas.
Number of components on a page
Based on an analysis of various customer implementations, we’ve found that Lightning pages with the right amount of components load faster, and Lightning implementation scales well overall. So how do we determine the right number of components?