3

I'm working on an instance where records are sent from Eloqua over to Salesforce in a single transaction of 300,000 to 500,000 records. I didn't find out until NOW.

Based on requirements, I've already created some before/after insert triggers for logic that Eloqua can't do.

My question is: Based on the sheer VOLUME: I assume triggers will not work, and I'm better to run scheduled APEX to run through all opportunities in the instance daily to make the necessary updates.

Is this true? False? Anyone help with a recommendation?

  • Can you go into detail about how you're importing those records into Salesforce (Apex DataLoader, Bulk API, Rest API, etc...)? – Derek F Aug 22 '17 at 20:28
  • Hi Derek! They are going through an Marketing Automation platform (Eloqua) and sent to salesforce using the API. Not sure which API (bulk, rest, etc). – RC82 Aug 23 '17 at 21:19
6

Triggers run against batches of (up to) 200 records, no matter if it's 200 records or 20,000,000 records. The API won't allow batches larger than 2,000, and this is typically unusual. Most data loads occur 200 records at a time. As long as each individual transaction does not exceed the governor limits, there won't be any problems with your data load process using triggers. The only difference is that the more trigger logic you have, the longer the data load will take. Using scheduled/batchable/queueable code runs the risk of database contention since they could conceivably run at the same time that Eloqua is trying to load the data.

  • 1
    sfdcfox! Thanks for responding! So, setting up a trigger to run business logic on those inserted records will be fine, as long as the code is bulkified. It will take a while, obviously, but the code will run fine. If I do a scheduled job, then it may be running during the insert and may get some errors especially if both transactions are attempting to access the same records. So I'm good with triggers then. Thanks!! (Let me know if I have it wrong) – RC82 Aug 23 '17 at 21:19
  • @RC82 Yes, that's the abbreviated version. Go with the triggers if possible. – sfdcfox Aug 23 '17 at 22:00

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.