Customer Data Sync: Database to Salesforce Objective: Build a scheduled, incremental synchronization that keeps a legacy MySQL customer database and Salesforce CRM consistent, so customer service and marketing campaigns work from one view of the customer. What's Getting Built customer-sync (Batch flow) — scheduled incremental sync driven by the scheduler component · SCHEDULER every 15m, BATCH 500/record MySQL Customers (System API) — read changed customer rows since the last run · SELECT /customers?modifiedSince Salesforce Accounts & Contacts (System API) — upsert by stable external ID · POST /Account, POST /Contact, PATCH /externalId /health (Experience API) — health check endpoint for external monitoring · GET /health dead-letter-queue — repeatedly failing records routed for reprocessing · PUBLISH, CONSUME 1. Business requirements Sync customer data from MySQL to Salesforce every 15 minutes. Handle new customer creation and updates to existing customers. Keep both systems consistent using an explicit conflict-resolution rule. Sync incrementally so only changed records are processed. Produce sync reports and notify owners when a run fails. 2. Technical specifications Source: MySQL customers table (id, first_name, last_name, email, phone, address, city, state, zip, created_date, modified_date). Target: Salesforce Account and Contact objects. Schedule: every 15 minutes, driven by the scheduler component. Batch size: 500 records per batch, tuned for throughput within API limits. Conflict resolution: the most recent modified timestamp wins. 3. Data transformation rules Map company customers to Account and individual customers to Contact. Combine first_name and last_name into the Contact name. Map the address fields onto the Salesforce billing address fields. Set Account.Type from your customer classification logic. Generate a stable external ID so re-runs deduplicate instead of inserting. 4. Error handling and resilience Retry database connection failures with a bounded backoff. Absorb Salesforce API rate limits with exponential backoff. Route repeatedly failing records to a dead letter queue for reprocessing. Email the integration owner when a sync run fails. Log every operation with a correlation ID so one record can be traced end to end. 5. Monitoring and reporting Track records processed, success rate, and processing time for each run. Publish a daily sync summary. Emit custom business events for Anypoint Monitoring. Expose a health check endpoint for external monitoring. 6. Security and compliance Encrypt data in transit and at rest. Apply field-level security to PII. Keep an audit trail of every data change. Support data masking to meet GDPR obligations. 7. Deployment and configuration Structure for CloudHub with per-environment configuration. Keep database and Salesforce credentials in secure properties. Log at a level that makes production troubleshooting possible. Make batch size and sync frequency configurable rather than hard-coded. Deliverable: A deployable Mule application with the sync flows, error-handling strategy, and monitoring hooks — commented to explain the business logic and the integration patterns chosen.