none
Implementation for SQLServerExpress : Improving performance by skipping tables that don’t need synchronization RRS feed

  • Question

  • I have found several posts which suggest that one canimprove the performance of Synchronization by skipping tables that do not need synchronization

    Is this true?

    Is there an implementation which works with SQLServer\Express and the tracking tables that are created when provisioning the database?

    Thanks.


    Howard P. Weiss

    Friday, August 15, 2014 8:20 PM

All replies

  • which sync providers are you using?
    Tuesday, August 19, 2014 12:54 AM
    Moderator
  • "Textbook" SqlSyncProvider and SyncOrchestrator

    using (SqlConnection clientConn = new SqlConnection(GetConnectionString(false)))
    {

        // master database connection
        using (SqlConnection masterConn = new SqlConnection(GetConnectionString(true)))
        {

            // create a sync orchestration object
            m_syncOrchestrator = new SyncOrchestrator();

            // set the local provider of sync orchestrator to the client sync provider
            using (SqlSyncProvider clientProvider = new SqlSyncProvider(syncScope, clientConn))
            {
                // set memory size (kb)
                clientProvider.MemoryDataCacheSize = MemorySize;

                // set batch size (kb)
                clientProvider.ApplicationTransactionSize = BatchSize;

                // set timeout to wait indefinitely
                clientProvider.CommandTimeout = 0;

                m_syncOrchestrator.LocalProvider = clientProvider;

                // set the remote provider of sync orchestrator to the master sync provider
                using (SqlSyncProvider masterProvider = new SqlSyncProvider(syncScope, masterConn))
                {
                                       
                    // set memory size (kb)
                    masterProvider.MemoryDataCacheSize = MemorySize;

                    // set batch size (kb)
                    masterProvider.ApplicationTransactionSize = BatchSize;

                     // set timeout to wait indefinitely
                    masterProvider.CommandTimeout = 0;

                    m_syncOrchestrator.RemoteProvider = masterProvider;

                    // set the direction to upload and download
                    m_syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;

                    // starts the synchronization session
                    SyncOperationStatistics syncStats = m_syncOrchestrator.Synchronize();
                }
            }
        }
    }

    GetConnectionString(true) returns connection string for "master" (remote); GetConnectionString(false) returns connection string for "client" (Local)


    Howard P. Weiss

    Tuesday, August 19, 2014 1:47 PM