-
-
Notifications
You must be signed in to change notification settings - Fork 30
Differences With DLRS
james simone edited this page Mar 31, 2023
·
2 revisions
This question has been asked many times - "what makes Apex Rollup different/better than DLRS"? The below summarizes a few of the key differences:
- Apex Rollup is an async-first solution; it does minimal processing on records prior to going async. Synchronous calculations are supported, they're just not the default
- DLRS relies on SOQL under the hood to perform calculations. That makes it prone to lots of different issues: speed (CPU timeout risk), row locking (random/inconsistent errors), and the SOQL query limits being the key ones. Apex Rollup performs the calculations for different rollup operations using Apex itself (hence the name!); SOQL is only used to retrieve records (it also can dynamically spawn batch jobs to retrieve records when any given query would exceed the query limit). This minimizes the CPU time spent communicating with the database and lets the code do the brunt of the work ... which it's very good at doing. Computers love math!
- Because DLRS relies on SOQL, it's limited to calculating sets of 50,000 records or less at once; it's not really set up to support organizations as they grow. Apex Rollup is specifically designed to scale to calculating rollups even for parent records that have large (50k+) numbers of children, as well as optimal processing when updating large sets of children
- DLRS' default (no-code) implementation relies on the Metadata API to create triggers on subscriber objects where rollups are needed. As we all know, having multiple triggers on objects is a big architectural no-no. While there are many different options for implementing DLRS that avoid this issue (scheduled rollups being one of the things I see frequently touted as the "solution" to performance problems people are facing), at that point, you're doing the same kind of configuration/copy-paste of code necessary to get something like Apex Rollup working, without the advantages of actually just using Apex Rollup instead
- Apex Rollup supports more types of rollup operations - you can do things like ALL/SOME/NONE to flag parent records that have children that meet certain criteria; you can make any rollup into a "group by rollup" to text or HTML format rollup info on a parent's rich or long text type fields