Syn framework 4.0 and sql server


Published on

In this presentation we introduce database syncronizacion with SQL Server and Sync Framework 4.0


Eduardo Castro Martinez

Published in: Technology
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Syn framework 4.0 and sql server

  1. 1. Building Offline Applications using Sync Framework, SQL Server and SQL Azure<br />Eduardo Castro Martinez<br /><br /><br />twitter: edocastro<br />
  2. 2. Session Objectives and Takeaways<br />Objectives:<br />Learn about the advantages of offline application architecture <br />Learn how to build offline applications to synchronize data across different client platforms using Sync Framework <br />Learn about developer choice and interoperability for 3rd party endpoints<br />Key Takeaway:<br />Offline applications have lots of benefits comparing to online applications, especially for mobile devices and cloud services <br />Sync Framework, SQL Azure and Windows Azure provide a data platform that makes it very easy to build offline applications and sync services.<br />Sync Framework caters for offline clients on any client platform, and provides better end-to-end support for Windows, Silverlight and Windows Phone 7 clients.<br />
  3. 3. Why Build Offline Capable Apps<br />Server / Service<br />Offline/Cached mode apps enjoy lots of value <br />Client apps get better UX through <br />Lower latency – data access doesn’t require round trips<br />Higher availability – app still runs if server is unreachable<br />Reduced network utilization – most data access is local<br />Servers gain better ability to schedule work asynchronously<br />Benefits of cached mode are magnified on the Internet<br />Server/service is further away<br />Network is less tuned/reliable<br />Remote Store<br />Sync<br />Offline Client<br />Client App<br />Query / Update<br />Local Data Cache<br />
  4. 4. Links<br />Sync Framework 4.0 Download<br /> <br />Developer Center<br /> <br />Sync SQL Server <br /> <br />
  5. 5. Windows<br />- SQL Server Express<br />- SQL Compact<br />Easy to develop the sync endpoints<br />Sync smarts on server, not on client<br />Client Offline Apps<br />Sync<br />Endpoints<br />SyncFx<br />Client API<br />support<br />Client API<br />support<br />Silverlight<br />Isolated Storage - <br />Other stores - <br />Auth / Mgmt / Bus Logic<br />Sync Service<br />SQL Server<br />Windows Phone 7<br /><ul><li>Isolated Storage
  6. 6. Other stores</li></ul>Simple protocol<br />(OData& Sync)<br />Windows Server / IIS<br />Cloud<br />Sync<br />Windows Mobile<br />SQL Compact - <br />On-Premises<br />Sync<br />Endpoints<br />SyncFx<br />Browser / HTML5<br />- HTML5 stores<br />Auth / Mgmt / Bus Logic<br />SQL Azure<br />Minimal client & store requirements<br />iPhone / Any Client<br />SQLite / Any store - <br />WindowsAzure<br />Sync Framework v4 Overview<br />
  7. 7. Introduction to Microsoft Sync Framework<br />Microsoft Sync Framework is a comprehensive synchronization platform enabling collaboration and offline for applications, services and devices. <br />Developers can build synchronization ecosystems that integrate any application, any data from any store using any protocol over any network. <br />
  8. 8. Introduction to Microsoft Sync Framework<br />A key aspect of Sync Framework is the ability to create custom providers<br />
  9. 9. Included Providers<br />Database synchronization providers: Synchronization for ADO.NET-enabled data sources<br />File synchronization provider: Synchronization for files and folders<br />Web synchronization components: Synchronization for FeedSync feeds such as RSS and ATOM feeds<br />
  10. 10. Participant Types<br />Full participants are devices that allow developers to create applications and new data stores directly on the device<br />Partial participants are devices that have the ability to store data either in the existing data store or another data store on the device. <br />
  11. 11. Participant Types<br />Simple participants are devices that are only capable of providing information when requested. <br />These devices cannot store or manipulate new data and are unable to support the creation of new applications<br />
  12. 12. Core Components<br />A provider built using Sync Framework communicates with a data source and retrieves state information from a metadata store<br />
  13. 13. Core Components<br />Data Source<br />The data source is the location where all information which needs to be synchronized is stored. <br />Could be a relational database, a file, a Web Service or even a custom data source included within a line of business application. <br />As long as you can programmatically access the data, it can participate in synchronization.<br />
  14. 14. Core Components<br />Metadata<br />Ability to store information about the data store and the objects within that data store with respect to state and change information<br />The metadata for a data store can be broken down into five key components<br />Versions Knowledge<br />Tick count Replica ID<br />Tombstones<br />
  15. 15. Synchronization Flow<br />
  16. 16. Conflicts are Detected and Resolved or Deferred<br />Source Wins: Changes made by the local replica always win in the event of a conflict.<br />Destination Wins: Remote replica always wins<br />Specified Replica ID Always Wins: No matter who changes an item, the replica with the designated ID always wins.<br />Last-Writer Wins: Based on the assumption that all replicas are trusted to make changes and wall clocks are synchronized, allow the last writer to win.<br />Merge: In the event of two duplicate items in conflict, merge the information from one into the other.<br />Log Conflict: Choose to simply log or defer the conflict.<br />
  17. 17. Sync Framework Database Synchronization<br />
  18. 18. Always Connected major disadvantages<br />Network Requirements<br />Data Access Speeds<br />Single Point of Failure<br />Server Scalability<br />
  19. 19. Occasionally Connected Application (OCA)<br />
  20. 20. Support data collaboration between databases<br />
  21. 21. Database Synchronization and the Microsoft Sync Framework<br />Comprehensive synchronization platform that enables developers to add synchronization capabilities to <br />applications, <br />services, and <br />devices. <br />Sync Framework solves the problem of how to synchronize any type of data in any store using any protocol over any topology<br />
  22. 22. Multiple Synchronization Topologies<br />
  23. 23. Multiple Synchronization Topologies<br />
  24. 24. HTML5<br />iPhone<br />Sync<br />Sync Service<br />Sync<br />+<br />Windows Mobile 6.5 <br />Sync<br />Windows Phone 7<br />Sync<br />Summary<br />Sync<br />Silverlight <br />
  25. 25. Offline applications on Silverlight desktop and Windows Phone 7<br />
  26. 26. Offline Applications Architecture - Server<br />Silverlight Offline Application<br />Silverlight Offline Application<br />Windows Azure Application<br />Cache Controller<br />OData Sync Endpoint<br />Sync<br />OData Sync Proxy<br />Isolated Storage Provider<br />Business Logic<br />SQL Azure<br />Provider<br />Sync Logic<br />Collections<br />Isolated Storage<br />SQL Azure<br />
  27. 27. Sync Service Overview<br />Data Store<br />Expose data from SQL Azure or SQL Server <br />Host<br />Hosted on Windows Azure or IIS/Windows Server<br />Exposed using a WCF sync endpoint <br />Protocol<br />Expose data for synchronization via a protocol and allow 3rd parties to build offline clients<br />Features<br />Support business logic extensity <br />Custom authentication / authorization<br />Filtering <br />Tooling<br />Provide a Tooling Wizard experience to configuring server and client <br />
  28. 28. Offline Applications in Silverlight <br />Silverlight Offline Client<br />Silverlight Offline Application<br />Windows Azure Application<br />Cache Controller<br />OData Sync Endpoint<br />Sync<br />Business Logic<br />SQL Azure<br />Provider<br />Sync Logic<br />OData Sync Proxy<br />Collections<br />Isolated Storage Provider<br />Isolated Storage<br />SQL Azure<br />Sync Logic<br /><ul><li>Sync Logic Moves to Server/Service
  29. 29. Enables Offline In Isolated Storage with Silverlight 3 & 4
  30. 30. Extensibility to allow 3rd party storage to be hooked in </li></li></ul><li>Offline Applications for all platforms<br />Offline application on any platform<br />Sync Application<br />Windows Azure Application<br />OData Sync Service<br />OData Sync Proxy<br />Sync<br />Business Logic<br />SQL Azure<br />Provider<br />Sync Logic<br />Collections<br />Store<br />SQL Azure<br />Client Needs To:<br /><ul><li>Track changes on local store (samples for common stores).
  31. 31. Implement client side sync proxy (samples for common platforms)</li></li></ul><li>Offline Application on HTML5 across browsers<br />
  32. 32. Offline Applications Architecture - Protocol <br />Simple protocol (OData & Sync)<br />Offline application on any platform<br />Sync Application<br />Windows Azure Application<br />OData Sync Service<br />OData Sync Proxy<br />Sync<br />Business Logic<br />SQL Azure<br />Provider<br />Sync Logic<br />Collections<br />Store<br />SQL Azure<br />
  33. 33. OData Protocol & Sync<br />Apply the principals of OData to the problem of data-sync<br />Standardize on protocol not on components<br />Minimal client sync logic or algorithms<br />Service manages sync keeping client simple<br />Provide samples to show how to consume protocol for any platform<br />Provide components for richer experience in Silverlight& WP7<br />Full interop details defined in SDK<br />
  34. 34. SQL Azure Data Sync CTP1<br />(Available now from <br /><br />Sync End to End Scenarios<br />Offline <br />Applications<br />Sync<br />Sync<br />Sync<br />Sync<br />On-Premises Applications<br />Sync<br />Sync<br />Sync<br />SQL Azure Database<br />Sync<br />Sync<br />Sync<br />Microsoft Sync Framework 4.0 <br />CTP available now! <br />Retail & Remote Offices<br />SQL Azure Data Sync<br /><br />SQL Azure Data Sync CTP2<br />(Coming in near future)<br />
  35. 35. Sync Framework – Offline SupportReleases and Roadmap<br />
  36. 36. Sync Framework – Offline Support Call to Action<br />For more information on Sync Framework 4.0 CTP <br />MSDN Developer Center:<br />Try it out<br />Download “Sync Framework 4.0 October 2010 CTP” from Microsoft Download Center <br />The sync service sample for Windows Azure or on-premises <br />Client samples for Silverlight, WP7, WM6.5 & iPhone, HTML5<br />Give feedback<br />Scenarios to support, capabilities or feature requests, preview release problems, etc… <br />
  37. 37. Building Offline Applications using Sync Framework, SQL Server and SQL Azure<br />Eduardo Castro Martinez<br />Arquitecto<br /><br /><br />twitter: edocastro<br />
  38. 38. Sources<br /><br /><br />
  39. 39. © 2009 Microsoft Corporation. All rights reserved. Microsoft, MSDN, the MSDN logo, and [list other trademarks referenced] are trademarks of the Microsoft group of companies.  <br />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.<br />