ADAPTIVE ALGORITHM FOR DYNAMIC DISTRIBUTION OF TRANSACTIONAL WORKLOAD BETWEEN SYNCHRONOUS AND ASYNCHRONOUS EXECUTION CONTEXTS IN SALESFORCE
DOI:
https://doi.org/10.46299/j.isjea.20260505.11Keywords:
Salesforce platform, governor limits, asynchronous processing, adaptive algorithm, transactional resources, Queueable Apex, workload distribution, runtime monitoringAbstract
This article proposes an adaptive algorithm for dynamic distribution of transactional workload between synchronous and asynchronous execution contexts on the Salesforce platform. The algorithm continuously monitors the consumption of governor-limited resources during transaction execution and, upon reaching a calculated safety threshold, defers the remaining business handlers to asynchronous processing through Queueable or Batch Apex contexts. A mathematical model of the resource safety margin is formalized, and a threshold selection criterion accounting for the worst-case cost of a single handler is derived. Experimental validation in a Salesforce Developer Edition environment with ten business handlers processing bulk operations of up to 10,000 records demonstrated complete elimination of governor limit violations, while the traditional static approach failed in 34% of high-load scenarios. The proposed algorithm increased the maximum sustainable handler count from 13 to over 40 and reduced synchronous transaction latency by 47% under peak load.References
Salesforce. (2024). Execution governors and limits. Apex Developer Guide. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm.
Salesforce. (2024). Asynchronous Apex. Trailhead. https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex.
Connecting Software. (2024). Salesforce governor limits explained. https://www.connecting-software.com/blog/salesforce-governor-limits-explained/.
O’Hara, K. (2013). SFDC trigger framework. GitHub. https://github.com/kevinohara80/sfdc-trigger-framework.
Fawcett, A. (2014). Apex enterprise patterns: Common Apex library. GitHub. https://github.com/apex-enterprise-patterns/fflib-apex-common
Spano, M. (2020). Trigger actions framework. GitHub. https://github.com/mitchspano/trigger-actions-framework.
Andrushchak, I., & Bandach, H. (2026). Comparative analysis of methods and algorithms for trigger-based transactional resource management in Salesforce. International Science Journal of Engineering & Agriculture.
Andrushchak, I., & Bandach, H. (2025). Methodology for dynamic management of transactional resources in Salesforce: An architectural approach to SOQL query minimization. International Science Journal of Engineering & Agriculture, 4(6). https://isg-journal.com/isjea/article/view/1119/672.
Andrushchak, I., & Bandach, H. (2026). Method of DML operation optimization in Salesforce based on the Unit of Work pattern. Lutsk National Technical University.
Fowler, M. (2002). Patterns of enterprise application architecture. Addison-Wesley Professional.
Pethad, C. A. (2020). Platform event trigger framework implementation in Salesforce Apex. Journal of Scientific and Engineering Research, 7(5), 391–394.
Cloud Sundial. (2021). The 3rd age of trigger frameworks. https://cloudsundial.com/the-third-age-of-trigger-frameworks.
ApexHours. (2024). Bulkification of Apex triggers. https://www.apexhours.com/bulkification-of-apex-triggers/.
Salesforce Architects. (2024). Record-triggered automation decision guide. https://architect.salesforce.com/decision-guides/trigger-automation.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Igor Andrushchak, Heorhii Bandach

This work is licensed under a Creative Commons Attribution 4.0 International License.




