Поделиться через


Sales Orders Sample Scenario

This sample highlights how a merge replication topology can be implemented to deliver data to mobile users, and it also demonstrates the programmability features of merge replication in SQL Server 2005. The sample is a Microsoft Windows Forms-based application that uses standard Microsoft data access technologies and merge replication to enable a salesperson to maintain her own local data while synchronizing periodically with the home office.

Sample Scenario

Adventure Works Cycles is a bicycle manufacturer that sells bicycles to retail bicycle shops throughout the United States and Canada. Adventure Works Cycles bicycles are sold direct to customers from their Web site and are purchased by the retail shops and resold at a markup; retail accounts are serviced by a nationwide sales force of Adventure Works Cycles sales professionals. This sales force is organized into sales territories, which are managed by Territory Sales Managers, who in turn report to the Vice President of Sales. Although all sales account data is maintained by the Adventure Works Cycles corporate office in Bothell, Washington, in a SQL Server 2005 database, individual salespersons are responsible for maintaining the sales-related data for their own accounts, including customer information and all sales and returns. Salespeople also must have access to the latest product-related data, including pricing, up-to-date inventory information, and individual historical sales data.

To best achieve its business goals, which includes providing the highest margins to its retailers, Adventure Works Cycles must minimize its operating costs while providing the most flexibility to its sales staff. To that end, Adventure Works Cycles has implemented a replication-based solution to managing its sales-related data. Each salesperson has been provided with a laptop or personal digital assistant (PDA), from which the salesperson uses a client application to enter sales data and view and modify customer and product information. Each laptop or device has a local copy of Adventure Works Cycles sales data provided by a merge replication subscription, which is partitioned based on their Windows login. At the end of the day, or whenever they can connect to the Internet, salespersons synchronize their local data by uploading local changes and downloading changes and updates to products from the company's AdventureWorks database information.

Replication Features Highlighted

This sample demonstrates the following features of merge replication:

Merge replication feature Description

Replication Management Objects (RMO) API

RMO is used to create the initial subscription and to synchronize and monitor the subscription. For more information, see Programming with Replication Management Objects.

Parameterized row filters

Each subscription is filtered horizontally using parameterized row filters, which enables each salesperson to only get the data related to that salesperson's sales territory. For more information, see Параметризованные фильтры строк.

Precomputed partitions

When data changes result in a row leaving a given partition, this work is done at the Publisher before the synchronization starts, which can result in significant performance improvements during synchronization. For more information, see Оптимизация производительности параметризованного фильтра с помощью предварительно вычисляемых секций.

Client-requested partitioned snapshot

Rather than having to manually create the partitioned snapshot for each subscriber, the partitioned snapshot is created when the subscriber requests it. For more information, see Моментальные снимки для публикаций слиянием с параметризованными фильтрами.

Business logic handler framework

This sample implements a business logic handler to invoke custom logic during synchronization. For more information, see Выполнение бизнес-логики при синхронизации слиянием.

Article type-based performance optimizations

The subscription for this sample uses articles that are specified as either download-only or as belonging to nonoverlapping partitions, which enables performance optimizations for the synchronization process. For more information, see Параметризованные фильтры строк and Оптимизация производительности репликации слиянием при работе со статьями, доступными только для загрузки.

SQL Server Compact Edition (SQL Server 2005 Compact Edition) Subscribers

The publication for this sample supports SQL Server 2005 Compact Edition Subscribers. For more information about programming replication for SQL Server 2005 Compact Edition Subscribers, see Программирование репликации в SQL Server Compact Edition.

Automatic identity range management

Replication does the hard work of managing the ranges assigned to identity columns when rows are inserted at the Subscriber and Publisher. For more information, see Репликация столбцов идентификаторов.

Web synchronization (optional)

You can optionally configure the Publisher so that subscriptions can be synchronized securely over the Internet using secure socket layer (SSL) technology, which enables a salesperson to synchronize data without having to establish a virtual private network (VPN) connection to the Publisher. For more information, see Веб-синхронизация для репликации слиянием.

Monitoring Replication

Replication provides system stored procedures on the Subscriber that return information on previous synchronization sessions.

См. также

Основные понятия

Sales Orders Sample Implementation Details

Другие ресурсы

Образец Sales Orders для репликации слиянием

Справка и поддержка

Получение помощи по SQL Server 2005