Descargar la presentación
La descarga está en progreso. Por favor, espere
1
Microsoft Sync Framework, el futuro
josemiguel.torres Microsoft Sync Framework, el futuro
2
agenda Entornos de sincronización Que és Microsoft Sync Framework
MS Sync Framework 2.0 y v.next SQL Azure DataSync Sync Services for ADO.NET 1.0/2.0 Sumario Recursos
3
Patrón ocasionalmente conectado
4
Tecnologías actuales Merge Replication RDA Custom
NO Detecta y resuelve conflictos Inicialización automática de esquema de BDD cliente Herramienta RAD Alto coste desarrollo Poco reutilizable Orientado a Servicios Seguimiento incremental de cambios Detección y resolución de conflictos Inicialización automática de esquema de BDD cliente Propagación de modificaciones sobre esquema
5
Microsoft Sync Framework
Interfaz Usuario Respuesta rápida Experiencia usuario rica Servicios Acceso desde cualquier lugar. Alta disponibilidad Sincronización siempre disponible. Optimización comunicaciones Únicamente se propagan las modificaciones. Coste hardware Uso frecuente caché de datos Extensiones para colaboración. Sincronización aún y cuando el servidor no está disponible.
6
Microsoft Sync Framework? Resolviendo problemas de una sola vez
Se ha apostado por la capacidad y la flexibilidad Capacidad: soluciona problemas complejos de sincronización Detección y resolución de conflictos Sincronizaciones atómicas antes problemas externos Fácil de usar y escalable Flexible Independiente de las réplicas Independiente de los protocolos Independiente de los tipos de datos Independiente de las tipologias de red © 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
Qué aporta Microsoft Sync Framework?
Facilita la sincronización entre participantes Facilita la participación de EndPoints propios. Proveedores built-in integrados : V1: Sistema de archivos, RSS, ADO.NET V2: SQL Azure, Live Mesh?, ADO.NET Data Services y más Herramientas integradas y experiencia de usuario Sync Services for ADO.NET SyncToy Project Codename “Anchorage” Sync Live Mesh SmugMug Syncable Store © 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.
8
Proveedores específicos
Sync File System Provider Relational Provider Simple Sharing Extensions (SSE) Provider
9
Higher-level services
Quiero obtener mi servidor offline Higher-level services Quiero sincronizar estos proveedores Quiero crear nuevos proveedores Built-in Endpoints Sync Runtime
10
En tres pasos… Inicialización y configuración de los proveedores
Configurar el agente de sincronización Seguimiento de resultados
11
Uso de Microsoft Sync Framework Cómo se lleva a cabo la sincronización
Sync Application Sync Orchestrator changes changes Sync Provider Sync Provider Data Store Data Store changes changes © 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
Uso de Microsoft Sync Framework Qué debo desarrollar
Aplicaciones Sync para sincronizar orígenes de datos. Utilizar built-in, proveedores de terceros o propios. Desarrollar Providers para tus orígenes y aplicaciones Utilizar Sync Runtime Elige: rendimiento vs complejidad © 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
Aplicacion Sync Así de fácil!
12/4/2017 9:50 AM Aplicacion Sync SyncOrchestrator orch = new SyncOrchestrator(); orch.LocalProvider = new FileSyncProvider( guid1, “c:\\temp\\myfolder”); orch.RemoteProvider = new LiveMeshProvider( guid2, new NetworkCreditial( username, password), “MyMeshFolder”); orch.Synchronize(); Así de fácil! © 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.
14
Sync Framework and Live Framework
Partnership App Store ? App Cloud LOE Web App Browser Sync Framework Live Framework Provider Client LOE Client LOE Sync Provider Sync Runtime App © 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.
15
Actores Que hay saber de MSF (Provider dev.)
12/4/2017 9:50 AM Actores Que hay saber de MSF (Provider dev.) ReplicaData ItemData Version Knowledge ... © 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.
16
MS Sync Framework v2 Mejorado el filtrado Conflictos
A nivel de columna “Negociación” de filtros Mejorado rendimiento Conflictos Resolución esp. restricciones Mejorado el logging © 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
On-Premises Applications Windows Azure Platform
12/4/2017 9:50 AM SQL Azure Data Sync Sync On-Premises Applications Sync Windows Azure Platform © 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.
18
On-Premises Sync Application Windows Azure Platform
12/4/2017 9:50 AM SQL Azure Data Sync On-Premises Sync Application Windows Azure Platform Sync Application Sync Orchestrator SQL Server SQL Azure SQL Server Sync Provider SQL Azure Sync Provider Sync Runtime © 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.
19
Clientes Sync Framework
Credit Suisse Relational PIM Data SyncToy Files SharePoint 2010 Favorites Relational Lists SharePoint Workspace 2010 (Groove) PricewaterhouseCoopers
20
DEMO FileSync
21
Servicios de sincronización para ADO.NET
SyncGroup SyncTable SyncTable Sync Agent SyncTable SyncTable SQL Server SQL Server Compact 3.5 Sync Provider DB Sync Provider for SQL Server
22
Microsoft Sync Framework
Tipologías Offline Información en caché Usuarios desconectados Collaboration Contactos, calendario y otros datos en cualquier lugar. Sincronización P2P Colaboración / Offline Microsoft Sync Framework
23
Offline de 2 capas Client Database SQL Server SyncCommand SyncCommand
Sync Agent Local Sync Provider SyncCommand SyncCommand SyncCommand Remote Sync Provider SyncGroup Client Database SyncTable SyncTable SQL Server SyncTable SyncTable
24
Exponiendo la solucion a N capas
SyncCommand SyncCommand Sync Agent SqlCeClient SyncProvider SyncCommand SyncCommand SyncCommand Server Sync Provider Transport SyncGroup SQL Server Compact 3.5 SyncTable SyncTable SQL Server SyncTable SyncTable
25
DEMO Local DataBase Cache
26
Situémonos… Envíame los cambios Aplica estos cambios idPieza
Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3 Modo Sincronización SyncTable’s Proveedor Remoto Sync Agent Envíame los cambios Para aplicar más tarde Aplica estos cambios Que me envió la otra parte idPieza Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3 Proveedor Local
27
Proveedor remoto idPieza Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3
1.- Inserta estas filas… 2.- Modifica estas filas… 3.- Elimina estas filas…. idPieza Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3 Proveedor Remoto Sync Agent 1.- ¿Qué filas se han añadido? 2.- ¿Qué filas se han modificado? 3.- ¿Qué filas se han eliminado? idPieza Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3 Proveedor Local
28
Seguimiento de cambios
Uso de Change Tracking SQL Server 2008 Personalizado Otros… Seguimiento de cambios
29
Configurando SQL Server 2008
Una característica [nueva] de SQL Server 2008. Almacena y gestiona todas y cada una de la modificaciones acontecidas sobre un cualquier registro. [Metadata] Se habilita a nivel de base de datos, y por cada tabla. Retiene las modificaciones durante un periodo especificado. Permite el seguimiento a nivel de columna. SQL Server provee un conjunto de funciones Si no utilizamos Change Tracking, ¿entonces qué?
30
Servidores personalizados
Si no utilizamos Change Tracking, utilizamos técnicas invasivas contra la base de datos. Se trata de identificar a nivel de fila cuándo [y quién] ha modificado o insertado la fila. Para las eliminaciones se utilizan tablas tombstone, mediante desencadenadores. idPieza Descripcion InsertId InsertTimeStamp UpdateId UpdateTimestamp 1 Pieza 1 A { A} B { C} 2 Pieza 2 { B} Null 3 Pieza 3 { D} { E}
31
DEMO SQL Server
32
Proveedor remoto SyncAdapter DataAdapter idPieza Descripcion 1 Pieza 1
Select Incremental Inserts Select Incremental Updates Select Incremental Deletes Sync Agent SyncAdapter DataAdapter SelectCommand InsertCommand Connection UpdateCommand Proveedor Remoto DeleteCommand Select Conflict Updated Rows… Podriamos mostrar un clase DbServerSyncProvider Select Conflict Deleted Rows… idPieza Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3
33
Proveedor remoto ¿Cómo identifico las filas insertadas? idPieza
SELECT * FROM Pieza WHERE [[han sido insertados desde la última vez] SELECT * FROM Pieza WHERE [han sido modificados desde la ultima vez] Sync Agent SELECT * FROM Pieza WHERE [han sido eliminadosdesde la ultima vez] Proveedor Remoto INSERT INTO Pieza (Descripcion) VALUES (‘xxxxx’) UPDATE Pieza SET Descripcion = ‘xxxx’ WHERE idPieza = ? DELETE Pieza WHERE idPieza = ? ¿Cómo identifico las filas insertadas? idPieza Descripcion 1 Pieza 1 2 Pieza 2 3 Pieza 3 ¿Y las modificadas y eliminadas? ¿Cómo sabremos cuál fue la ultima vez?
34
Entendiendo las variables de sesión
¿Cuál es la versión actual? Variables del contexto de la sincronización que denotan la versión actual. ¿Cuál es la versión de la última sincronización? Variables del contexto de la sincronización que denotan la versión de la última sincronización. ¿Quién ha modificado? Variables que identifican quién o qué cliente (consumidor) ha modificado. ¿Es la primera inicialización? …
35
DEMO Proveedor Remoto
36
Proveedor de sincronización local
Almacena la información de estado de las tablas locales que van a intervenir en la sincronización. Propaga las modificaciones acontecidas en las tablas hacía el proveedor remoto, desde la última sincronización. Aplica las modificaciones incrementales acontecidas en el proveedor remoto a la base de datos local. Detección de conflictos. Existe un proveedor específico para SQL Server Compact 3.5. Establece toda la complejidad y comportamiento de forma transparente para el desarrollador.
37
Inicializar la base de datos local
Únicamente se requiere de la existencia del archivo de base de datos. Se propaga TODA la definición de la tabla que interviene en la sincronización, excepto: La restricciones FOREIGN KEY, UNIQUE y DEFAULT. Podemos intervenir en la creación del esquema en tiempo de ejecución. Foreign key, unique y default
38
DEMO Proveedor Local
39
Manejo de conflictos Conflictos se detectan a nivel de fila.
Los errores durante la sincronización son un tipo de conflicto. Importante evitar conjunto de datos susceptibles de conflicto innecesariamente. Uso recomendado de Filtros. Pueden tener lugar tanto en el Servidor como en el Cliente. Tipos: Cliente elimina y servidor actualiza (un mismo registro) Cliente inserta y servidor inserta (un mismo registro) Cliente actualiza y servidor elimina (un mismo registro) Cliente actualiza y servidor actualiza (un mismo registro)
40
Mostrar ejemplo de base de datos cache…
DEMO Control de conflictos
41
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
42
¡¡¡Muchas gracias!!!! josemiguel@desarrollomobile.net
Blog: Twitter: ¡¡¡Muchas gracias!!!!
Presentaciones similares
© 2025 SlidePlayer.es Inc.
All rights reserved.