-
-
Notifications
You must be signed in to change notification settings - Fork 30
Differences With DLRS
James Simone edited this page Feb 24, 2022
·
2 revisions
This question was originally brought up via Pablo Gonzalez on Reddit, but I thought to expand upon the original answer here in a dedicated resource:
- 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!
- 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