Tamilselvan C
Founder & CEO
Winfomi
Solution Approach for Salesforce and AWS RDS Integration
This document outlines the solution approach for integrating Salesforcewith AWS RDS. The integration includes a one-time manual data upload from Salesforce to AWS RDS, real-time synchronization from Salesforce to AWS RDS via API calls, and scheduled synchronization from AWS RDS to Salesforce using a cron job.
1. Environment Setup on AWS
EC2 Instance:
- Deploy an EC2 instance to host the Node.js application handling API calls and scheduled tasks
Node.js Application:
- Create a Node.js project with endpoints for real-time data processing and scripts for scheduled sync.
Database (AWS RDS):
- Configure the RDS instance to ensure connectivity with the EC2 instance, applying necessary security measures.
2. One-Time Initial Data Upload
Manual Export from Salesforce:
- Perform a one-time manual export of Salesforce data using Data Loader or Salesforce’s Export tools.
- Format the data (e.g., as CSV) for SQL insertion.
Data Transfer to EC2:
- Transfer the exported files to the EC2 instance directly or via AWS S3.
SQL Import to RDS:
- Use SQL scripts or an ETL tool to batch insert data into RDS tables.
- Verify data integrity by comparing records in RDS with Salesforce.
3. Real-Time Data Sync: Salesforce to AWS RDS
Salesforce to Node.js API:
- Configure Salesforce to make real-time API calls to the Node.js application whenever data changes.
- The Node.js API receives the data and processes it immediately.
Data Insertion to RDS
- Upon receiving the data, the API processes it and inserts or updates the relevant tables in RDS.
- Apply rate limits to manage high data volumes, batching inserts/updates where necessary.
4. Scheduled Sync (Cron Job): AWS RDS to Salesforce
Scheduled Cron on EC2:
- Set up a cron job to run every 5 minutes on the EC2 instance.
- The cron job triggers a script in the Node.js app to query new or updated data from RDS within the last 5 minutes.
Sync to Salesforce:
- The Node.js script uses the Salesforce API to insert or update records in Salesforce based on changes in RDS.
- Apply limits to fetch a maximum of 500 records from RDS and batch updates of 200 records for efficient processing and to stay within Salesforce limits.
5. Node.js Application Logic and Scripts
API and Sync Logic:
- Implement the Node.js application with two main functions: one for real-time processing from Salesforce to RDS, and one for scheduled sync from RDS to Salesforce.
- Use appropriate error handling and retries for network and API rate limits.
Transaction Logging:
- Log transaction details using CloudWatch and enable CloudTrail for API interaction history.
- Configure alerts for errors or sync issues for quick troubleshooting.
6. Access and Security
Salesforce Whitelisting:
- Whitelist the EC2 instance’s IP address in Salesforce to allow API calls securely.
Rate Limit Controls:
- Implement limits to manage API rate limits for both real-time and scheduled sync processes.
7. Monitoring and Alerts
CloudWatch and CloudTrail:
- Use CloudWatch to monitor API and data sync status and capture API interactions with CloudTrail.
Alerts:
- Set alerts for sync errors or performance issues to proactively manage integration health.