METHOD OF DML OPERATION OPTIMIZATION IN SALESFORCE BASED ON THE UNIT OF WORK PATTERN: AN ARCHITECTURAL APPROACH TO TRANSACTIONAL CHANGE CONSOLIDATION

Authors

DOI:

https://doi.org/10.28925/2663-4023.2026.35.1322

Keywords:

Salesforce, Unit of Work, DML operations, transactional resources, governor limits, optimization, multi-tenant architecture, design patterns

Abstract

The article presents a method for optimizing Data Manipulation Language (DML) operations on the Salesforce platform based on the Unit of Work architectural pattern. The multi-tenant architecture of the Salesforce platform imposes strict constraints on the number of DML operations within a single transaction: a maximum of 150 statements for the synchronous execution context. As business logic complexity and trigger handler count grow, each handler independently executes its own insert, update, and delete operations, causing linear growth of DML resource consumption and increasing the risk of transaction failures. The paper formalizes a mathematical model of DML operation consumption describing the dependency of statement count on the number of active handlers, the number of object types, and the transactional coupling coefficient. The proposed method introduces a centralized change management layer that accumulates all pending data modifications from business handlers in a change registry and executes them in consolidated form at the end of the transaction while respecting dependency ordering between objects. It is proven that under the Unit of Work pattern, the DML statement count is determined solely by the number of unique combinations of object type and operation kind and does not depend on the number of business handlers, which provides mathematically guaranteed compliance with platform constraints. Experimental validation was conducted in a Salesforce Developer Edition environment on a test bench with five business handlers during bulk processing of 200 records. Experimental results confirmed a 73% reduction in DML statement count compared to the traditional approach, a 42% reduction in transaction execution time, and a 28% reduction in CPU time consumption. The proposed method, combined with the previously developed data access centralization methodology, forms a complete approach to transactional resource management covering both data read and data write operations.

Downloads

Download data is not yet available.

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

Fowler, M. (2002). Patterns of Enterprise Application Architecture. Addison-Wesley Professional.

Fawcett, A. (2014). Apex Enterprise Patterns: Common Apex Library. GitHub. https://github.com/apex-enterprise-patterns/fflib-apex-common

Salesforce. (2024). Apex Developer Guide: Bulk DML Exception Handling. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_bulk_exceptions.htm

Salesforce. (2024). Bulk Apex Triggers. Trailhead. https://trailhead.salesforce.com/content/learn/modules/apex_triggers/apex_triggers_bulk

Cloud Sundial. (2021). The 3rd Age of Trigger Frameworks. https://cloudsundial.com/the-third-age-of-trigger-frameworks

Andrushchak, I., & Bondarchuk, 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). Comparative analysis of methods and algorithms for trigger-based transactional resource management in Salesforce. International Science Journal of Engineering & Agriculture.

Pethad, C. A. (2020). Platform Event Trigger Framework Implementation in Salesforce Apex. Journal of Scientific and Engineering Research, 7(5), 391–394.

Spano, M. (2020). Trigger Actions Framework. GitHub. https://github.com/mitchspano/trigger-actions-framework

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


Abstract views: 3

Published

2026-10-26

How to Cite

Andrushchak, I., & Bandach, H. (2026). METHOD OF DML OPERATION OPTIMIZATION IN SALESFORCE BASED ON THE UNIT OF WORK PATTERN: AN ARCHITECTURAL APPROACH TO TRANSACTIONAL CHANGE CONSOLIDATION. Electronic Professional Scientific Journal «Cybersecurity: Education, Science, Technique», 3(35), 64–70. https://doi.org/10.28925/2663-4023.2026.35.1322