API quota violations and resource-efficient alternatives
Key Takeaway
A quota violation means custom code is using the platform inefficiently. When an enforced quota is exceeded, an exception stops the current operation, so redesign the code instead of catching the exception.
B2C Commerce quotas are built-in limits on memory use, resource consumption, API calls, and the number of business objects that custom code can create or use. Quotas keep the platform efficient and stable. Code that exceeds a quota is usually misusing an API when a more resource-efficient way to do the same job exists. So the fix is to change the design, not to work around the error.
What quotas measure
Quotas monitor how custom code uses platform resources such as memory, application server threads, and database table sizes. A quota violation is a design signal, because it typically means the code uses a capability inefficiently and a more efficient solution is possible.
There are two groups of quotas. API quotas limit things like the number of object instances, object sizes, runtimes, and executions per page. Some API quotas block a B2C Commerce Script method or pipelet in the storefront.
Object quotas limit how many objects of a type exist per instance. Object relation quotas limit how many objects can be tied to one object. For example, a basket can hold at most 400 product line items, with a warning at 200.