Best practices for quotas, transactions and scalable code
How to spot and fix B2C Commerce code that breaks the documented performance and stability standards: quota violations, search post-processing, variant loops, live calls, long-running controllers, oversized transactions, shared-data writes and SFRA anti-patterns.
Given code that violates documented best practices, identify the issues and modify the code to conform with best practices including performance and scalability.
~8 min read · 13 practice questions ·
What the exam expects
- Read a quota status or quota exception and pick the documented response: correct the code, never catch the exception.
- Replace search post-processing, variant loops and unpaged result sets with query criteria, index-friendly APIs and paging.
- Keep storefront requests fast: no live third-party calls on busy pages without a low timeout, no long-running work, light OnSession and OnRequest logic, cacheable GET routes.
- Keep writes safe: small transactions, shared data read-only in storefront requests.
- Flag SFRA anti-patterns: controllers calling controllers, pipelets with script equivalents,
pdictmisuse, edited base cartridges.
Key terms: quota (a monitored limit on memory, API calls or object counts in custom code); enforced quota (one whose limit throws an exception); touched business objects (the persistent objects a request loads or changes); shared data (catalogs and prices that every shopper reads); customer-specific data (profiles, carts, orders).
Key facts
- Detail
- 60% of the quota limit
- Detail
- Exception stops the operation; storefront shows the general error page
- Detail
- Production: Salesforce Support only; sandbox: import settings from production
- Detail
- Updated with up to a 20-minute delay
- Detail
- Maximum of 120 products per page
- Detail
- Low, for example 1 second
- Detail
- Closed by the web tier after 5 minutes
- Detail
- Up to 1,000 modified business objects
- Detail
- Limit logic over 10 ms
- Detail
- GET only; POST never cached
- Detail
- 10 MB, then processing is canceled
- Detail
- Controller requests 5 minutes; OCAPI hooks 30 seconds
- When are the Private Keys and Certificates quotas updated?
- Why can't quota settings be imported to make a production instance softer?
- What happens when an ISML template generates more than 10 MB of output?
- When may order processing jobs start modifying a new order?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the B2C Commerce Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the B2C Commerce Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Practice exams purchase adds inline bank questions and topic practice (13 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Choose guide-only, practice-only, or save $4 with both