Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Sync Framework Advances

Similar presentations


Presentation on theme: "Microsoft Sync Framework Advances"— Presentation transcript:

1 Microsoft Sync Framework Advances
Rahul Gangwar Partner Technical Consultant| Microsoft |

2 Agenda Introduction to Sync Framework
New features in Sync Framework 2.0 Sync Services for ADO.NET Demo of Sync Services on Windows Mobile client

3 Why Sync Service Sync! Rich Client Thin Client

4 Why Sync Service Client App Client App
An application is already an independent component having independent data store. We want it to sync itself with a service/with peers without writing any code to it. It effectively turns your application into a distributed model whether through the service or p2p synchronization. Client App Client App

5 Why use a Framework? Sync is hard
4/16/2017 8:57 PM Why use a Framework? Sync is hard All stores are different Some are very capable, most are not Conflicts are difficult to detect And even harder to manage afterwards Misidentification of conflicts  bad experience Duplicates, over-prompting, data loss Inefficient change enumeration makes sync too expensive Sync loops are a fact of life Few people set out to get into one, many end up in one 80% solution much simpler than 100% Corner cases are everywhere! Why would anyone care to use a FRAMEWORK for implementing sync. We use a framework for various reasons: When we are interested in building the same kind of solution again and again When we want to hide the lower level details which do not focus on non-functional requirements. In case of sync this could be conflict detection, resolution, performance, sync loops, reliability etc. We want to address these common problems once and probably for always in the form of using the framework. Economy Reasons: Even if we are not interested in using the full capability of sync framework, we might be interested in using an already built framework capability to save our development efforts. There are other reasons as well. Let’s see: It turns out that the sync solutions are difficult to be implemented. One of the problems is that the stores that you need to synchronize are very different. Some of them are highly capable and some are very less capable and both of these kind of stores has its own set of challenges. Like stores which are less capable are difficult to synchronize because they do not have much to offer while stores which are very capable are hard to synchronize because we want to make use of all their capability to provide justice to all of their capabilities and provide performance benefits. Conflicts: Conflicts cannot be avoided in a typical sync solution. Conflicts are difficult to be detected (for some stores), difficult to be handled once they are detected. If we do not handle conflicts appropriately, it could either give bad user experience or data loss. Change enumeration is rarely supported by stores. This is a problem because the data keeps on moving from one point to another even if it did not changed. This makes sync process costly in terms of bandwidth consumption, performance etc. Sync loops is something that sync solutions get into even when they don’t originally intend to. Because even if people build individual links, when you put all these links together, synchronization loops often emerge and are difficult to be handled unless you provision for them from the beginning. Most importantly, building a 80% correct solution is significantly difficult than building a 100% correct solution. As we move towards perfection, or the figure 100, each step grows difficult. That said, moving from 99.99% to % is the hardest figure to achieve. This is true with almost any domain but with sync solutions it is important because the number of corner cases are large like loss of metadata, various kinds of connection interruptions etc. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Why Microsoft Sync Framework? Solving hard problems exactly once
4/16/2017 8:57 PM Why Microsoft Sync Framework? Solving hard problems exactly once We strike for the balance of power and flexibility Powerful: solve hard sync problems Conflict detection and resolution Unreliable networks, i.e. interruptions/partial syncs Loops, metadata loss, etc Easy-to-use and performant Flexible Arbitrary stores Arbitrary protocols Arbitrary data types Arbitrary topologies This is what Microsoft sync Framework is set out to accomplish. The reason to create a framework is: We observed that many of the problems that we have discussed in the last slide are independent on underlying data store independent on the protocol used Or even the topology in which sync solution is connected (like p2p, via cloud etc.) We are set out to solve these problems in a way that are indifferent of these assumption. Like we will take care of conflict detection, take care of unreliable network etc. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Using Microsoft Sync Framework How synchronization happens
Sync Application Sync Orchestrator changes changes Sync Provider Sync Provider Data Store Data Store changes changes

8 Writing a Sync Application
4/16/2017 8:57 PM Writing a Sync Application SyncOrchestrator orch = new SyncOrchestrator(); orch.LocalProvider = new FileSyncProvider(guid1, “c:\\temp\\myfolder”); orch.RemoteProvider = new LiveMeshProvider(guid2, new NetworkCreditial(username, password), “MyMeshFolder”); orch.Synchronize(); Not too hard! © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Sync Services for FileSystems
DEMO Sync Services for FileSystems

10 Change Unit Filtering Name email Phone Address Photograph
4/16/2017 8:57 PM Change Unit Filtering Name Phone Address Photograph Contact on Notebook Name Phone Contact on Small Device Sync Framework 1.0 supports the ability to track knowledge for subitem elements named change units. Sync Framework 2.0 adds the ability to specify a change unit filter. A change unit filter is a set of change units that are tracked by using knowledge that differs from the knowledge for the remaining change units. A change unit filter is useful when a replica only stores a subset of the change units defined for the items in the scope. For example, a synchronization community exchanges contact information, and defines change units for name, phone number, and address. One replica in the community is a mobile device that can only store name and phone number. This replica uses a change unit filter to specify that it only tracks knowledge for these two change units. When a source replica synchronizes data to the device replica, it uses the change unit filter to send information only about the name and phone number change units. The learned knowledge from the source provider is projected onto the change unit filter so the knowledge on the device replica contains knowledge of only the name and phone number change units. Similarly, when a change is made locally on the device and the device subsequently acts as the source replica in a synchronization session, the replica that receives the changes updates its knowledge only for the specified set of change units. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Provider Negotiated Filters
4/16/2017 8:57 PM Provider Negotiated Filters *.txt Provider *.txt Provider *.jpg filter filter *.wmv File System Orchestrator Interested Party Sync Framework 2.0 adds the ability for the destination provider to specify the filter that is used by the source provider during change enumeration. The source provider can accept or deny the filter that the destination provider requested. The destination provider can continue to request filters until one is found that the source provider accepts. This negotiation is mediated by Sync Framework. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 What does Microsoft Sync Framework do?
4/16/2017 8:57 PM What does Microsoft Sync Framework do? Makes it easy for you to sync participating endpoints Makes it easy for your endpoint to participate Comes with built-in endpoints: V1: File System, Relational Databases V2: SQL Data Services, Live Mesh, ADO.NET Data Services and more Provides integrated tools and user experiences Sync Services for ADO.NET SyncToy  Project Codename “Anchorage” Sync Live Mesh SmugMug Store Syncable Here in this slide we will discuss about what a developer needs to do to use the sync framework. This has not changed since and remains same between v1 and v2 because of the simplicity of its use. The easiest way to use sync framework is to synchronize participating stores. You basically take two of these stores and you sync them using sync framework. The second way is to take your store and turn it into a synchronizable store. That is where sync runtime comes in. Sync framework comes with built in support for certain end points. V1 supported file systems and relational databases. In V2 we are adding support for many more end points. If you happen to work with these end points, use the built in providers and save your time. If the endpoint that you are looking at is not inbuilt, build your own provider using the provider framework that comes along with the sync framework. Just to give you an idea, ability to write your own provider is new in V2 and you can do that using simple to use interfaces and APIs and use all the benefits of the sync runtime thereafter. We will not cover provider framework today but just wanted to give an idea that this is new capability built into V2. The new inbuilt end points that we have planned are like SQL Data Services, .. Windows 7 etc. We have also built integrated tools and user experience on top of the sync framework. One of them is sync services for ADO.NET which is very powerful tool for taking relational databases offline and these tools are built into Visual Studio. We will cover this during the end of presentation. Another is SyncToy, which is again another end-to-end experience on top of sync framework. Sync Toy allows you to synchronize folder pairs and we are taking that experience forward with the project code name Anchorage. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 Synching ADO.NET Data Service OR “Taking ADO.NET Data Service offline”
ADO.NET Data Service exposes data source over cloud. Sync Framework brings offline capability to data source. Combining these two will expose data source over cloud with offline capability. Astoria Client Sync Framework

14 Sync Services for ADO.NET
Local Storage Fetch Synchronize SQL Server Application Fetch Update Local Storage: Typically in an application architecture we have two sides: the application side and the data source side. The application interacts with data sources like SQL Server Database. The kind of interaction typically belongs to fetching data from database, processing and changing the data at application side and then reflecting the changes back to SQL Server. In such scenario there are certain points where we can improve the end user experience. Take for example, the fetch phase. It happens many times during a typical session. Application need to fetch data from database many times during a single session and imagine if for some reasons the link between application and database is lost. This is typically an inevitable scenario in disconnected architectures like sales people using the application on their laptops in field. So how would the end user continue her work while ignoring the connection loss? The solution to such problems lies in local data cache at application side. If we could fetch the data from SQL Server that is required in a session during the first launch and cache it locally and then keep working on the local data source instead of central database, we could not only allow the end user to keep working irrespective of database connectivity but also improve upon performance of the application (now we do not need to go anywhere for data access) and at same time we could scale the SQL server (now communication between SQL server and client is not done frequently). So the first thing that we need is a local data storage solution and we have come up with SQL Server Compact. Let us discuss a little bit about SQL Server Compact before moving ahead.

15 Sync Services for ADO.NET
DEMO Sync Services for ADO.NET Using “n” tier Architecture Synchronization done via web services

16 4/16/2017 8:57 PM Summary Sync Framework v2 is the easiest and most efficient way to synchronize your data with Live Mesh, File systems, Databases, ADO.NET Data Services, SQL Data Services, and more. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Resources Sync Developer Center http://msdn.microsoft.com/sync
SDK (including documentation) Whitepapers Samples (including several end-to-end) Sync Blog Announcements Tips and Tricks SQL Labs Cutting edge prototypes and pre-release functionality

18 Feedback / QnA Your Feedback is Important!
Please take a few moments to fill out our online feedback form. Use the Question Manager on LiveMeeting to ask your questions now!

19 Contact Blog Address http://blogs.msdn.com/rahul/ Email Address

20


Download ppt "Microsoft Sync Framework Advances"

Similar presentations


Ads by Google