---
schema_version: "1"
id: a0fd45a27dfdd1e00422309344810117566e7213960de11098d16975980eab2b
title: Retaining Customer Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/retaining_customer_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.retaining_customer_data.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f9d6737748503e34a79f41a578d67127d8bbd4090327df6bfd6906380192b4ae
description: Heroku Connect syncs your data to your Heroku data store, which can affect storage usage and run time.
products:
  - Security
  - Cross Cloud
release: "264"
---
# Retaining Customer Data

Heroku Connect syncs your data to your Heroku data store, which can affect storage usage and run time.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: all editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
      <colgroup>
        <col style="width:50%">
        <col style="width:50%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d29775e52">User Permissions Needed</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d29775e52 ">To retain customer information using Heroku:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d29775e52 ">ModifyAllData and PrivacyCenter</td>

        </tr>
      </tbody>
    </table>

When retaining customer data, Heroku Connect first syncs all the records for your selected objects with your chosen fields. After the full sync completes, the filtered records are inserted into the Heroku cache scheme based on the criteria and parent-child relationships defined in your policy. With the cache populated, the records are then updated or deleted in Salesforce, and the Heroku cache contains the latest values from the unmodified Salesforce data.

For a given object and field configuration, a full sync is required. After that, only the delta changes are processed. Therefore, the run time for a policy execution is longer for a new object-field configuration, with subsequent runs potentially orders of magnitude quicker.

## Storage Usage & Run Time

This synchronization process also temporarily inflates your storage usage. Because Heroku Connect works by replicating your Salesforce org data, all data associated with your selected objects is synced from your Salesforce org to your Postgres data store. Then the data to be retained is copied into a second table in the database. At this point, both the synced and copied data count towards your storage limit. But don’t fret. Heroku Connect performs another sync later, and any duplicate data between the synced and copied data tables is deleted from the Postgres storage. You’re left with the data you want retained and the rest of the data associated with your selected objects stored in the Postgres data store.

For example, say you have 3 Salesforce objects that together make up 750 GB of Postgres data. Of this 750 GB, you want to retain 250 GB. You create a retention policy that specifies the data you want to retain. During execution, Heroku Connect syncs all 750 GB of data with your Postgres data store. Then it executes the archival job, copying 250 GB of data to a second set of tables in the same database. At this point, you’re at 1 TB of your 1.5-TB total storage limit, even though your total archival storage goal is only 250 GB. After the policy is completed, Heroku Connect syncs your data again, and the 250 GB of data in your Postgres store is deleted. The deleted records are simultaneously removed from your Salesforce org. By the end, your storage is at 750 GB total, with 500 GB in the Postgres tables and 250 GB in the retention table.

Text area fields can also affect your data storage, as multiple Long Text and Rich Text area fields can lead to a larger amount of data to be stored. Heroku Connect manages this increased data by splitting the record retrieval, which results in a higher number of API calls. We recommend that you retain only the data objects and fields that are explicitly called out in your company’s data retention requirements.

## Limitations

Run time also scales directly with the number of filtered records processed in a single policy execution. To keep down the run time, Privacy Center limits you to selecting only a subset of fields for retention. Limiting the number of retained fields promotes lean data practices and improves Heroku Connect’s sync performance. API execution time also varies depending on whether you’re deleting or transforming customer data because different behind-the-scenes data operations are executed for each.

In general, you can reduce the run time by creating policies that are no more than two layers deep. By sticking to only parent and child levels, you decrease the volume of data stored and improve Privacy Center’s performance. You can also reduce run time by reducing the record count of objects for a single policy. To view object record counts, go to the Setup homepage, and select **Storage Usage** in the sidebar. By factoring in the record count, you can pinpoint the objects that are most likely to affect the runtime of the object-field configuration.