Job Development for Performance and Stability

⚠️ The annual cost of maintaining the server where this website is hosted, the domain, and keeping it up-to-date is approximately €3,000 per year. Help us with a small donation to cover these expenses. Support Now!

0 / 10000

To optimize job performance, follow the job development standards.

  • To modify objects in Salesforce B2C Commerce, we recommend that you use standard imports instead of customizations. In jobs, use B2C Commerce Job Steps for imports.
  • B2C Commerce standard imports are designed to process arbitrary feed sizes. Changes are committed to the database on a per business object basis. If related changes must be committed in a single transaction, enclose the import pipelets in an explicit pipeline transaction. Choose this approach only as an exception. The transaction size limit applies. Ensure that this limit isn't exceeded.
  • The transaction size is limited to 1,000 modified business objects. Ensure that this limit isn't exceeded. B2C Commerce does not enforce this limit today, but might in the future.
  • Don't implement data validation jobs on B2C Commerce (for example, products with no names or $0 prices). Instead, ensure that the feeds into B2C Commerce are of high quality, and don't include products with incomplete attribution or are marked offline. You can manually review catalog data on a staging instance.
  • When processing large data sets, pay attention to the memory footprint:
    • Design loop logic so that memory consumption doesn't increase with result set size.
    • Keep only currently processed objects in memory, and do not retain references to that object (so that the object can be freed from memory). Specifically, don't perform sorting or other types of collections in memory.
    • Stream data to file regularly (do not build large structures in memory).
    • Read feeds record by record (do not read an entire file into memory).
  • If you must create multiple feeds, query the objects once and write records to all feeds as you iterate over the results. This approach saves time because the objects must be created in memory only once.
  • Avoid concurrent changes to the same object. Use the locking framework to ensure exclusive access. Specify named resources for job schedules.
  • Keep application server utilization by jobs to a minimum. Calculate the job load factor: total number of seconds of job execution time on an instance (Staging or Production) on a day divided by 86,400 (number of seconds in a day). Try to keep the job load factor below 0.20.
  • Pay attention to recovery in solution design. A job might end abnormally, for example, server restart or application server failure. The job can be resumed or restarted. Design the job so that it recovers gracefully. It must be possible to repeat a job step that was aborted.
  • Don't start many jobs at the same time. Instead, disperse job start times to balance the job load.