Calculating the Salesforce quota
The Salesforce endpoint leverages Salesforce APIs to provide Full Load and Change Processing replication functionality. When using the Salesforce endpoint, it's important to be aware of the API quota limits in order to plan your replication tasks accordingly.
Replicate utilizes the following Salesforce APIs:
- SOAP API requests - Used for Full Load and Apply Changes replication tasks. This API will be used for Full Load when the Soap API option is selected in the Advanced tab.
- Bulk API - Used or Full Load replication only. This API will be used for Full Load when the Bulk API option is selected in the Advanced tab (the default). In some cases, such as lookup and replication of metadata, the Soap API will be used even when Bulk API is selected.
- Streaming API - Used for Apply Changes replication tasks
Both Bulk API and Streaming API consumption can be monitored using Salesforce REST API requests. The output of these requests is a JSON file containing current quota consumption values. The relevant values from a Replicate perspective are as follows:
- DailyBulkApiRequests - The current Bulk API quota.
- DurableStreamingApiConcurrentClients - The current Streaming API allowed clients.
- MonthlyPlatformEvents - The number of captured Change Operations sent by Salesforce. To calculate the Change Operations quota per day, divide this value by 30.
For information about these quotas and their limits, and for information on monitoring Bulk API and Streaming API consumption, refer to the Salesforce Developer Help.
Quota consumption by Replicate:
Full Load only tasks
Full Load only tasks consume ~20 SOAP API requests per table (for meta-data and test connections). The actual number of requests consumed is proportionate to the number of tables being replicated: the greater the number of tables, the lesser the number of requests required per table.
When Bulk API is used for Full Load:
If the endpoint's PK chunking option is enabled, from the perspective of SOAP API request consumption, each chunk is the equivalent of a table.
Additionally, the endpoint consumes a single Bulk API request per table and a single Bulk API request per PK chunk (when enabled).
For each table:
(~20 * [number of chunks] SOAP API units) + (1+ [number of chunks] Bulk API units)
When SOAP API is used for Full Load:
For every 200 rows unloaded, one quota unit is consumed. For example, a table with 1000 rows will consume five quota units.
For each table:
(~20 * SOAP API units) + (1 + [Rows of table]/200 SOAP API units)
Apply Changes only tasks
Apply Changes only tasks consume 10 SOAP API requests per table. For Streaming API requests, Apply Changes only tasks consume a single quota unit per applied change. Changes that require column lookup (when there is a big textarea value) consume a single SOAP API request per change.
For Apply Changes of a single table:
(10 SOAP API units) + ([number of changes] Streaming API units) + [number of rows require lookup] soap API units
When working with Apply Changes and/or Store Changes tasks, the Salesforce endpoint subscribes to a single Streaming API channel which logs change information for all tables. From a quota perspective, to prevent the Streaming API channel from being read multiple times (thereby increasing quota consumption), best practice is to set up a single task.