KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Optimizing web pages for scalability
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: October 16, 2023

When developing a web application, consider optimizing page load time to improve user experience, especially when dealing with a large amount of data and users.

For example, suppose that all records from a table need to be loaded and displayed in a multi-page interface. One approach would be to query for all records and send the data to the page upon initial request, and then do any desired filtering and sorting on the frontend. This approach will probably work fine with ~1k records and <100 users. However, when there is closer to ~1M records and >100 users, the web application’s performance may start to suffer.

A better approach would be to load the data in chunks per page as needed, with any filtering and sorting done on the backend. ORDA has many powerful class functions to help accomplish this, including entitySelection.slice() to portion data, entitySelection.orderBy() to sort data, and entitySelections.query() to filter data. There is also entitySelection.distinct() to consolidate duplicate values if needed.