SF-Data-Arch Data Modeling and Database Design Practice Question
An architect is building a data model for a subscription service. They need to calculate the total revenue across all related 'Invoice' records for an 'Account'. Which approach should they use?
⚠ Common exam trap
Candidates often propose writing custom trigger code or asynchronous batch jobs for simple aggregations, overlooking native declarative features that provide automated and efficient roll-up calculations.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a Roll-up Summary field on the Account object.
Roll-up summary fields are the native, declarative way to perform aggregate calculations across master-detail relationships. They are highly efficient, automatically updated by the platform, and require no code. This ensures the revenue data is always accurate and available for reporting, dashboards, and list views, which is essential for sales teams tracking customer lifetime value.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Write a Trigger to calculate and update the total on the Account.
Why it's wrong here
Triggers introduce technical debt and maintenance requirements. If a native declarative solution like a roll-up summary field exists, it should always be preferred. Custom code is harder to test, document, and scale, and it can lead to hitting governor limits if the trigger logic is not optimized correctly.
- ✓
Use a Roll-up Summary field on the Account object.
Why this is correct
Roll-up summary fields provide an out-of-the-box solution for aggregating data from child records. They are performance-optimized by Salesforce and maintain data consistency without the risk of logic errors associated with custom code. This is the recommended approach for any aggregation across master-detail relationships in a standard data model.
- ✗
Create a Flow that triggers on every Invoice insert.
Why it's wrong here
While Flows are powerful, they are not the most efficient way to perform simple aggregation. Running a flow for every invoice insertion can lead to system latency and hit limits in high-volume environments. Roll-up summaries are handled at the database level and are inherently more performant and reliable for this use case.
- ✗
Calculate the revenue dynamically using a Formula field.
Why it's wrong here
Formula fields cannot aggregate data from related child records. They can only perform calculations based on fields on the current record or fields on its direct parent. A formula cannot 'see' or summarize a list of child invoices, making this approach technically impossible for the described business requirement.
About these practice questions
This SF-Data-Arch question is part of Courseiva's 222-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-Data-Arch practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-Data-Arch exam.