Extended Configuration

Table of Contents

  1. Connection Configuration
  2. Performance Settings
  3. Debug Options
  4. Column Handling
  5. Data Transformation
  6. Retry Configuration
  7. Rate Limit Settings

Connection Configuration

Settings that control connection pooling and management.

connection_config = {
    "advanced.connection.max_connections_per_sp": 50,  # Maximum connections per service principal (1-100)
    "advanced.connection.blocking": True,              # Whether connection requests block when pool is full
    "advanced.connection.use_multi_pool": False,       # Use separate pools for each service principal
}
SettingTypeDefaultDescription
max_connections_per_spint50Maximum connections per service principal. Dynamics 365 limit is 52
blockingboolTrueIf True, waits for connection when pool is full. If False, raises error
use_multi_poolboolFalseWhen True, creates separate connection pools for each service principal

Performance Settings

Settings that affect processing performance and resource utilization.

performance_config = {
    "advanced.performance.num_workers": 32,                    # Thread pool size
    "advanced.performance.batching_enabled": True,            # Enable batch processing
    "advanced.performance.batch_size": 10_000,               # Records per batch
    "advanced.performance.deferred_retry_enabled": False,     # Enable deferred retry mechanism
    "advanced.performance.deferred_batch_size": 1000,        # Records per deferred batch
    "advanced.performance.max_deferred_retries": 3,          # Maximum retry attempts
    "advanced.performance.deferred_retry_delay": 300,        # Initial retry delay (seconds)
    "advanced.performance.pushdown_filter_enabled": True,    # Use key-based filtering
    "advanced.performance.max_pushdown_filter": 100_000,     # Maximum records for pushdown
    "advanced.performance.bulk_insert_with_fallback": False, # Try bulk insert before fallback
    "advanced.performance.query_builder_caching_enabled": True, # Cache query builders
    "advanced.performance.id_based_strategy_enabled": False   # Use ID-based strategy
}
SettingTypeDefaultDescription
num_workersint32Number of concurrent worker threads
batching_enabledboolTrueEnable processing in batches
batch_sizeint10,000Number of records per batch
deferred_retry_enabledboolFalseEnable retry mechanism for failed operations
deferred_batch_sizeint1,000Number of records per retry batch
max_deferred_retriesint3Maximum number of retry attempts
deferred_retry_delayint300Delay between retry attempts (seconds)
pushdown_filter_enabledboolTrueEnable database-side filtering
max_pushdown_filterint100,000Maximum records for pushdown filtering
bulk_insert_with_fallbackboolFalseAttempt bulk insert before single inserts
query_builder_caching_enabledboolTrueCache query templates
id_based_strategy_enabledboolFalseUse ID-based upsert strategy

Debug Options

Settings for troubleshooting and debugging.

debug_config = {
    "advanced.debug.cache_queries": False,           # Cache executed queries
    "advanced.debug.disable_helper_text": False,     # Disable helper text output
    "advanced.debug.raise_on_failure": False,        # Raise exceptions on failures
    "advanced.debug.log_queries": False,             # Log executed queries
    "advanced.debug.log_batch_mapping": False,       # Log batch mapping details
    "advanced.debug.log_skips_missed": False,        # Log skipped records
    "advanced.debug.sampling_enabled": False,        # Enable data sampling
    "advanced.debug.sample_condition": None,         # SQL condition for sampling
    "advanced.debug.sample_size": None,              # Number of records to sample
    "advanced.debug.sample_seed": None,              # Random seed for sampling
    "advanced.debug.profiling_enabled": False        # Enable performance profiling
}
SettingTypeDefaultDescription
cache_queriesboolFalseStore executed queries in memory
disable_helper_textboolFalseDisable informational messages
raise_on_failureboolFalseRaise exceptions instead of logging
log_queriesboolFalseLog SQL queries to table
log_batch_mappingboolFalseLog batch processing details
log_skips_missedboolFalseLog records that should have been skipped
sampling_enabledboolFalseEnable data sampling
sample_conditionstrNoneWHERE clause for sampling
sample_sizeintNoneNumber of records to sample
sample_seedintNoneSeed for reproducible sampling
profiling_enabledboolFalseEnable performance profiling

Column Handling

Settings for column management and processing.

column_config = {
    "advanced.columns.target_pk_column": "id",           # Primary key column
    "advanced.columns.target_prefix": "target__",        # Prefix for target columns
    "advanced.columns.target_read_columns": ["id"],      # Required target columns
    "advanced.columns.target_conditional_columns": ["statecode", "statuscode"],  # State columns
    "advanced.columns.exclude_columns": [],              # Columns to exclude
    "advanced.columns.include_only_columns": [],         # Columns to include
    "advanced.columns.legacy_compare_values": False,     # Use legacy comparison
    "advanced.columns.compare_case_insensitive": False,  # Case-insensitive comparison
    "advanced.columns.use_extended_state_codes": False   # Use extended state codes
}
SettingTypeDefaultDescription
target_pk_columnstr"id"Primary key column name
target_prefixstr"target__"Prefix for target comparison columns
target_read_columnsList[str]["id"]Required columns in target queries
target_conditional_columnsList[str]["statecode", "statuscode"]State management columns
exclude_columnsList[str][]Columns to exclude from processing
include_only_columnsList[str][]Only process these columns
legacy_compare_valuesboolFalseUse legacy value comparison
compare_case_insensitiveboolFalseIgnore case in comparisons
use_extended_state_codesboolFalseUse extended state code mapping

Data Transformation

Settings for data transformation and sanitization.

data_transform_config = {
    "advanced.data_transformation.sanitization_rules": [],     # Data cleaning rules
    "advanced.data_transformation.normalize_owner_columns": True,  # Normalize ownership
    "advanced.data_transformation.case_insensitive_columns": []    # Case-insensitive cols
}
SettingTypeDefaultDescription
sanitization_rulesList[Rule][]Data cleaning rules
normalize_owner_columnsboolTrueNormalize ownership columns
case_insensitive_columnsList[str][]Case-insensitive columns

Retry Configuration

Settings for operation retry behavior.

retry_config = {
    "advanced.retry.enabled": False,      # Enable retry mechanism
    "advanced.retry.max_attempts": 3,     # Maximum retry attempts
    "advanced.retry.base_delay": 2,       # Base delay seconds
    "advanced.retry.max_delay": 60,       # Maximum delay seconds
    "advanced.retry.jitter": 1.5          # Jitter factor
}
SettingTypeDefaultDescription
enabledboolFalseEnable automatic retries
max_attemptsint3Maximum retry attempts
base_delayint2Base delay between retries
max_delayint60Maximum retry delay
jitterfloat1.5Random jitter factor

Rate Limit Settings

Settings for rate limit simulation and handling.

rate_limit_config = {
    "advanced.rate_limit_simulation.enabled": False,           # Enable simulation
    "advanced.rate_limit_simulation.error_frequency": 0.1,     # Error frequency
    "advanced.rate_limit_simulation.retry_after_range": (3.0, 10.0),  # Retry range
    "advanced.rate_limit_simulation.sequential_errors": 0,     # Sequential errors
    "advanced.rate_limit_simulation.error_types_sequence": None  # Error sequence
}
SettingTypeDefaultDescription
enabledboolFalseEnable rate limit simulation
error_frequencyfloat0.1Frequency of simulated errors
retry_after_rangetuple(3.0, 10.0)Range for retry delays
sequential_errorsint0Number of sequential errors
error_types_sequenceList[str]NoneSpecific error sequence

Example Configuration

Here's an example of a comprehensive configuration:

config = {
    # Connection settings
    "advanced.connection.use_multi_pool": True,
    "advanced.connection.max_connections_per_sp": 50,
    
    # Performance settings
    "advanced.performance.num_workers": 1600,
    "advanced.performance.batch_size": 50_000,
    "advanced.performance.id_based_strategy_enabled": True,
    
    # Debug settings
    "advanced.debug.log_queries": True,
    "advanced.debug.log_batch_mapping": True,
    
    # Column settings
    "advanced.columns.exclude_columns": ["owningteam_id", "owningteam_logicalname"],
    
    # Retry settings
    "advanced.retry.enabled": True,
    "advanced.performance.deferred_retry_enabled": True
}

dynamics_client.update_config(config)