1

I have a question regarding Heroku Connect rows and Salesforce Sandbox refreshes.

Heroku Connect cares about how many unique rows are synced in a given period. Even if that row becomes unsynced, it still counts toward the total.

During a salesforce full/partial sandbox refresh, the entire org is swapped and the records are re-inserted into a new org (I believe with entirely new SFIDs).

The question is, does a sandbox refresh double the rows Heroku Connect "syncs" and if so, what is the best practice to not have the double counting?

Example:

The staging sandbox has 100 contact records in it (with SFIDs, 1-100). Heroku Connect is syncing 100 rows (SFIDs 1-100). The sandbox is refreshed, and the same contact records are uploaded to the new org, but given SFIDs (101-200). Heroku Connect by default will have 200 rows - though the desired outcome is a swap.

Potential Solution:

Heroku Connect can be configured to use a Unique Heroku identifier instead of using the SFID as the primary key.

This Heroku Unique ID can be included in the data fresh on the sandbox. If we used a Heroku unique id, would this allow Heroku Connect to pull the records from the refreshed sandbox without appending a new set of data?

Thank you!

0

If you do a refresh a sandbox, you need to "reload the mapping". This means your table will be truncated and reloaded anew. This will consume a significant number of API calls, although it shouldn't matter in most cases, since you should have plenty of API calls to spare.

Reloading a mapping truncates the mapped table in your Postgres database, removing all existing data, and then reloads all records from Salesforce. The process used to reload the data is the same as that used when a mapping is initially populated and will make use of the SOAP or Bulk API depending on the number of records to be reloaded. It’s important to note that this operation will result in assignment of new values for the ‘ID’ column.

For mappings with a large number of records you should consider putting your application into maintenance mode while the process completes.

  • The API calls are one thing, but total quantity of synced rows is a separate measurement. Salesforce tracks API calls, Heroku tracks synced rows. Since Heroku Connect uses the batch api, you are right that the API calls shouldn't be an issue. But creating new rows in Heroku Connect, even if the old rows are no longer connected still count as additional synced rows. Performance is the same, but the billing is radically different between appending new rows (or replacing) versus remapping. Does that make sense? – ZAR Oct 30 '18 at 15:00
  • @ZAR I have zero experience with HC, but long story short, if you refresh a sandbox, you are creating new records from its perspective. I don't know of a way around that, other than to not sync sandboxes. You might ask Salesforce for an alternative, but I don't think there's much of a way around it. In fact, we specifically rejected HC as a viable solution for testing, and use it only in production because of the cost of billing for synced rows. – sfdcfox Oct 30 '18 at 15:46
  • thank you for taking the time to respond. What you describe is precisely my fear. I'm speaking with SF now and will update if we come across a new solution. You mentioned rejecting HC for testing - what are you using instead? Are you just using the raw bulk API to sync changes or is there an alternative to Connect? All of our apps rely on hosted pSQL instances, and managing realtime changes between pSQL and SF seems like a lot, but you would know much better than I would! – ZAR Oct 30 '18 at 15:54
  • @ZAR I don't know enough about the integration to know for sure, but presumably, we replicate test data for use in test environments. If I had to hazard a guess, it's probably just a Data Loader export or Informatica or something. Salesforce is the primary source of truth, and we don't do two-way synchronization, so that might also affect the overall decision on how to proceed. – sfdcfox Oct 30 '18 at 15:58
  • "Don't do two-way sync", that's the catch. The reason we're running Heroku Connect is specifically for the 2-way sync. Thanks for the help @sfdcfox! – ZAR Oct 30 '18 at 16:02
0

The staging sandbox has 100 contact records in it (with SFIDs, 1-100). Heroku Connect is syncing 100 rows (SFIDs 1-100). The sandbox is refreshed, and the same contact records are uploaded to the new org, but given SFIDs (101-200). Heroku Connect by default will have 200 rows - though the desired outcome is a swap.

This isn't quite how things work. When you refresh a sandbox, you create a new Salesforce sandbox org with a new organization ID. Your old sandbox org will be marked as inactive, and Heroku Connect will stop syncing it, as described in this Knowledge Base article.

At this point, you should export your configuration as described in the KB article and also in the main Dev Center article, and then re-create the add-on. You should also delete the old add-on -- this way, Heroku Connect will be managing the number of rows that you expect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.