Store only tables that are synchronized by Connect in your Connect schema. Your stakeholders include developers, your Salesforce-side team, and other business teams that depend on this data. They must know about changes and the timeframe because updating mappings can result in delays when syncing new data from Salesforce to the database.
The regular sync process from Salesforce to Heroku is paused until the bulk load finishes, which slows down Heroku Connect.įor a table already mapped with a large number of records, data can appear stale while the new fields are synchronized.īefore changing a mapping, ensure that all stakeholders are notified. Avoid Frequent Changes to MappingsĪdding a new field to a large table fires a bulk job to backfill the corresponding database column with the Salesforce data (unless the new field is empty). If there are yellow or red flags for these checks, review your mappings and reduce the number of fields mapped if possible. Run heroku connect:diagnose and check the Number of Fields and Number of Large Text Area Fields diagnostic checks. Heroku Connect Diagnostics helps you identify the number of mappings and number of fields per object that’s optimal for your connection. Note that the performance penalty is only paid on mappings that have several of these large text area fields. The extra time spent querying Salesforce’s API decreases the performance of Heroku Connect for the mapping(s) containing these fields. This means that Heroku Connect must make many more network requests to fetch your data than it would without those fields being mapped. Mapped fields that are Long Text Area or Rich Text Area tend to hold large amounts of data. The Salesforce API imposes restrictions on the size of responses or generated bulk results files. Minimize the number of large string and text fields in your mapping.Performance can severely degrade when many fields are mapped. When Heroku Connect pulls data from Salesforce, it reads in the entire record at once. Choose the minimum number of fields required for your use case.Keep mapped objects small to minimize the size of requests to Salesforce and improve sync speed. Potential Pitfalls for the Merged Writes Algorithm.Potential Pitfalls for the Ordered Writes Algorithm.Review the potential pitfalls carefully for each algorithm to choose the best one for your use case. It is not possible to perform bulk writes to Salesforce when using the Merged Writes algorithm. The Ordered Writes algorithm is a prerequisite for using the Bulk API.
Avoid Merged Writes if you have circular dependencies or use Apex triggers or process rules in Salesforce. In general, if you make many rapid changes in succession, Merged Writes is better for performance. When Heroku Connect is configured with bi-directional sync, determine which write algorithm, Ordered Writes or Merged Writes, is efficient for your use case. Choose the Best Write Algorithm For Your Use Case Watch out for these messages in your Heroku Connect logs, for example, BULK write batch to MAPPING_NAME ended due to REASON Will fall back to SOAP.įor more info, see Bulk vs SOAP API. Failed inserts cause a fallback from using the Bulk API to the SOAP API. Then all data is written to the database in one SQL statement. For example, in a Rails app, handle lookups and calculations in before_save callbacks rather than after_save. If you expect to update a record many times within a short period, make rapid changes in a staging table and move the record to the mapped table after it is stable.Saving unchanged records triggers unnecessary syncs. Save only changed records to mapped Heroku Connect tables.Review the conditions of when each API is used and follow write patterns that use the Bulk API: Use at least Salesforce API v39 so you can use the Bulk API.