Best practices for tuning contact API performance in high-volume sync operations

Our contact synchronization process in Dynamics 365 Sales 9.0 is struggling with performance as our database has grown to 500K+ contacts. We’re syncing updates from our master customer database nightly, processing 50K-100K contact records. Current sync takes 6-8 hours, which is cutting into our maintenance window.

We’re using the Web API with standard REST calls, processing contacts sequentially with some basic parallelization (5 threads). I know we should be using batch operations and better parallelization strategies, but I’m not clear on the optimal approach. What’s the sweet spot for batch sizes? How much parallelization can the API handle before throttling becomes an issue? Are there specific query optimization techniques for large contact datasets?

Six hours for 100K contacts is definitely suboptimal. You should be able to process that volume in under 2 hours with proper optimization. First priority: implement change tracking if you haven’t already. With 500K total contacts, you’re probably only updating 5-10% nightly. Change tracking lets you query just modified records, dramatically reducing the data volume. Second, increase your parallelization - 5 threads is too conservative. Start with 20-30 threads and monitor for throttling responses.