Upload
donald-atkinson
View
229
Download
0
Embed Size (px)
Citation preview
SQL Mobile 2005: SQL Mobile 2005: OverviewOverview
Gaurav Khanna, Developer EvangelistGaurav Khanna, Developer EvangelistDeveloper & Platform EvangelismDeveloper & Platform EvangelismMicrosoft Corporation (India)Microsoft Corporation (India)
AgendaAgenda
• IntroductionIntroduction• Supported PlatformSupported Platform• Release Schedule & LicenseRelease Schedule & License• ArchitectureArchitecture• FeaturesFeatures• Data SyncData Sync• PerformancePerformance
IntroductionIntroduction• MobilityMobility
Freedom to work anywhere with up to date dataFreedom to work anywhere with up to date data Connected and DisconnectedConnected and Disconnected
• Offline/Disconnected solutionOffline/Disconnected solution App can execute without a connectionApp can execute without a connection
Client side business logic executes on deviceClient side business logic executes on device Data store on deviceData store on device Data is Synchronized with Backend serverData is Synchronized with Backend server Integrated with enterprise appsIntegrated with enterprise apps
• Customer ScenariosCustomer Scenarios Field Force AutomationField Force Automation DSDDSD HealthcareHealthcare CRMCRM Inventory Inventory MilitaryMilitary
Introduction – SQL MobileIntroduction – SQL Mobile• SQL CE 3.0 or SQL Server 2005 Mobile SQL CE 3.0 or SQL Server 2005 Mobile
EditionEdition• Relational database with small foot printRelational database with small foot print• New code base - developed from scratchNew code base - developed from scratch• ADO and OLEDB programming interfaceADO and OLEDB programming interface• Desktop access/management for Desktop access/management for
developmentdevelopment• Multi user accessMulti user access• Sync mechanism with SQL Server (2000, Sync mechanism with SQL Server (2000,
2005)2005)• SecuritySecurity
• Dependant upon .NET CF 2Dependant upon .NET CF 2
SQL Mobile –Platform, Schedule, SQL Mobile –Platform, Schedule, LicenseLicense• Pocket PC 2003, Phone Pocket PC 2003, Phone
edition(03,05)edition(03,05)• Smart Phone 5.0Smart Phone 5.0• Windows CE.NET 5.0Windows CE.NET 5.0• Tablet PCTablet PCReleaseReleaseWith VS 2005 and SQL 2005With VS 2005 and SQL 2005Beta1 & Beta2 already releasedBeta1 & Beta2 already released
LicenseLicense•Same as SQL CE 2.0Same as SQL CE 2.0•Desktop development for DB if VS 2005 or Desktop development for DB if VS 2005 or SQL Server 2005 installedSQL Server 2005 installed
Platform – Project Types Platform – Project Types • DeviceDevice
Pocket PC 2003Pocket PC 2003 Windows Mobile 5.0Windows Mobile 5.0 Smartphone Mobile 5.0Smartphone Mobile 5.0 Win CE 5.0Win CE 5.0
Storage EngineStorage Engine
Internal SE APIInternal SE APIeDB APIeDB API
QPQP
Internal QP APIInternal QP API
SQL Mobile - SQL Mobile - Architecture Architecture
ReplicationReplicationandandRDARDA
OLEDB / OLEDB / Replication APIReplication API
CLIENTCLIENT SERVERSERVER
IISIIS
Server Server Agent: Agent:
ReplicationReplicationandand
Remote Remote Data Data
AccessAccessHTTPHTTP
XML/BizTalk/CS XML/BizTalk/CS 2002/DTS2002/DTS
Enterprise BackendEnterprise Backend
Oracle / db2 / etcOracle / db2 / etc
Occasionally Occasionally ConnectedConnected
OLE DBOLE DB
PIM AppsPIM Apps Native AppsNative Apps Managed SQL CE + eDB AppsManaged SQL CE + eDB Apps
VS 2005 C++VS 2005 C++
CLR / .NET CFCLR / .NET CF
SQL Mobile Data SQL Mobile Data ProviderProvider
SQL Client SQL Client Provider Provider
VS 2005 (VB.NET, C#)VS 2005 (VB.NET, C#)
AgendaAgenda
• IntroductionIntroduction• Supported PlatformSupported Platform• Release Schedule & LicenseRelease Schedule & License• ArchitectureArchitecture• FeaturesFeatures• Data SyncData Sync• PerformancePerformance
SQL Mobile - Feature SetSQL Mobile - Feature Set• Desktop DevelopmentDesktop Development
Tablet PC, Scaling and Deployment testingTablet PC, Scaling and Deployment testing• Integration with VS 2005Integration with VS 2005• Integration with SQL Server 2005Integration with SQL Server 2005• SQL (DDL/DML) SupportSQL (DDL/DML) Support
• Powerful Sync mechanismPowerful Sync mechanism Column Level TrackingColumn Level Tracking Multiple subscriptionMultiple subscription Download only articlesDownload only articles Conflict ResolutionConflict Resolution
• Programming InterfaceProgramming Interface ADO.NETADO.NET OLEDBOLEDB
• Improvement for GPRS connectivityImprovement for GPRS connectivity• Features for better performanceFeatures for better performance
New SQLCEResultSet & many moreNew SQLCEResultSet & many more• DTS SupportDTS Support• Easy migration from SQL CE 2.0Easy migration from SQL CE 2.0
SQL Mobile New Features SQL Mobile New Features – Storage Engine– Storage Engine• Storage engine re-written to further Storage engine re-written to further
optimize for mobile applicationsoptimize for mobile applications• Multi-User supportMulti-User support
Row level locking dataRow level locking data Lock EscalationLock Escalation
• Improved stabilityImproved stability• Auto re-use of empty pagesAuto re-use of empty pages
SQL Mobile New Features SQL Mobile New Features – Query Processor– Query Processor• ShowPlanShowPlan• Query Optimization HintsQuery Optimization Hints
View Plan and do performance tuningView Plan and do performance tuning• Named parameters/Parameterized Named parameters/Parameterized
QueriesQueries
SQL Server 2005 SQL Server 2005 Management Studio Management Studio IntegrationIntegration• Same user experience, SQL Server or SQL MobileSame user experience, SQL Server or SQL Mobile• Functionally equivalentFunctionally equivalent
Object ExplorerObject Explorer Query EditorQuery Editor Management DialogsManagement Dialogs
• CapabilitiesCapabilities Create SQL Mobile DatabasesCreate SQL Mobile Databases Show Plan and HintsShow Plan and Hints Faster OptimizationFaster Optimization Enhanced PublicationEnhanced Publication Subscription WizardSubscription Wizard DTS SupportDTS Support
Visual Studio 2005 Visual Studio 2005 IntegrationIntegration• Integrated with Server ExplorerIntegrated with Server Explorer
Connect to SDF on device, emulator, or desktopConnect to SDF on device, emulator, or desktop Manage database schema, view / edit dataManage database schema, view / edit data
• Drag and Drop GenerationDrag and Drop Generation Drag tables and columns onto form to create databound Drag tables and columns onto form to create databound
controlscontrols SqlCeResultSet class, enables performant, type safe, SqlCeResultSet class, enables performant, type safe,
cursor style developmentcursor style development Enabled in the DataSource window for drag and Enabled in the DataSource window for drag and
drop developmentdrop development• End to End development.End to End development.
Add SDF to your projectAdd SDF to your projectIf the database hasn’t changed, it won’t get deployedIf the database hasn’t changed, it won’t get deployedEnsures the database is R/W for databases under source Ensures the database is R/W for databases under source controlcontrolDatabase in Server Explorer shows the database management Database in Server Explorer shows the database management toolstools
AgendaAgenda
• IntroductionIntroduction• Supported PlatformSupported Platform• Release Schedule & LicenseRelease Schedule & License• ArchitectureArchitecture• FeaturesFeatures• Data SyncData Sync• PerformancePerformance
Challenges in Mobile SyncChallenges in Mobile Sync• ConcurrencyConcurrency
Division of workflow across mobile user Division of workflow across mobile user basebase
Data changing on device, server, or bothData changing on device, server, or both Conflict resolution (Single Master vs. Multi-Conflict resolution (Single Master vs. Multi-
Master)Master)
• ConnectivityConnectivity ReliabilityReliability BandwidthBandwidth Security/FirewallsSecurity/Firewalls
• AdministrationAdministration
Choosing Sync ArchitectureChoosing Sync ArchitectureConsider Your Options….Consider Your Options….
• XML Web ServicesXML Web Services You design and control all behavioral aspectsYou design and control all behavioral aspects Only option for non-SQL Server synchronizationOnly option for non-SQL Server synchronization
• Remote Data Access (RDA)Remote Data Access (RDA) SQL-driven PULL and PUSH model SQL-driven PULL and PUSH model Change tracking with optimistic concurrency Change tracking with optimistic concurrency
• Merge ReplicationMerge Replication Publisher - Subscriber Model Publisher - Subscriber Model Advanced tracking and conflict resolutionAdvanced tracking and conflict resolution Centralized Control over Pubs and SubscribersCentralized Control over Pubs and Subscribers
Choosing Sync ArchitectureChoosing Sync ArchitectureStart at the beginning…Start at the beginning…• Questions for Architecture Planning:Questions for Architecture Planning:
Read-only data on device with occasional Read-only data on device with occasional updates?updates?
Data changing at one end or the other?Data changing at one end or the other? Data changing at both ends concurrently?Data changing at both ends concurrently? How large is the data to be synchronized?How large is the data to be synchronized?
Remote data access (RDA)Remote data access (RDA)
• RDA provides loosely-coupled RDA provides loosely-coupled connectivity between SQL CE & SQL connectivity between SQL CE & SQL ServerServertalks to SQL Server w/o being talks to SQL Server w/o being
“connected”“connected”store SQL Server query results directly in store SQL Server query results directly in
SQL CESQL CEautomatically tracks changes locallyautomatically tracks changes locally
send locally changed records back to SQL send locally changed records back to SQL ServerServer
RDA ArchitectureRDA Architecture
SQL CEServerAgent
SQL ServerOLE DBProvider
SQL ServerDatabase
InternetInformationServer (IIS)
HTTP
Application
SQL CE Client Agent
Database
SQL CE Engine
OL
E D
B
OLE DB
Merge ReplicationMerge ReplicationOverviewOverview• Provides data synchronization Provides data synchronization
between SQL Mobile and SQL Serverbetween SQL Mobile and SQL Server SQL Server is the publisherSQL Server is the publisher SQL Mobile is the subscriberSQL Mobile is the subscriber
• SQL Mobile receives initial snapshot SQL Mobile receives initial snapshot from SQL Serverfrom SQL Server
• Both SQL Mobile and SQL Server can Both SQL Mobile and SQL Server can modify the datamodify the data Conflict resolution can be customizedConflict resolution can be customized
Choosing A Data Sync Choosing A Data Sync StrategyStrategy
CRITERIACRITERIA BEST BEST CHOICECHOICE VIABLEVIABLE CHALLENGINCHALLENGIN
GG
Connectivity - WWAN/DialupConnectivity - WWAN/Dialup RDARDA WSWS MergeMerge
Connectivity - WLANConnectivity - WLAN RDARDA WS/MergeWS/Merge
Conflict ResolutionConflict Resolution MergeMerge WSWS RDARDA
Code to ImplementCode to Implement RDA/RDA/MergeMerge WSWS
Setup/Deployment EffortSetup/Deployment Effort RDARDA WSWS MergeMerge
Enterprise ManagementEnterprise Management MergeMerge WSWS RDARDA
Large Data VolumesLarge Data Volumes Merge/Merge/RDARDA WSWS
Server DBMS IndependenceServer DBMS Independence WSWS MergeMerge
Auto SQL CE DBMS CreationAuto SQL CE DBMS Creation MergeMerge
Ability to Secure Data SyncAbility to Secure Data Sync MergeMerge RDA/WSRDA/WS
SQLCESQLCE
Choosing Sync ArchitectureChoosing Sync ArchitectureGeneric Decision FlowchartGeneric Decision Flowchart
Server to Sync With
Sync Connectivity
Conflict Likelihood
Typical Sync Payload
Importance of Central Control
Need for Fine Sync
Control
Web Services
MergeReplication
RDA
SQL Server
WLAN/Ethernet
High High
Low
GPRSDialup
Other
High
< 1 MB
Low
> 1 MB
Low
AgendaAgenda
• IntroductionIntroduction• Supported PlatformSupported Platform• Release Schedule & LicenseRelease Schedule & License• ArchitectureArchitecture• FeaturesFeatures• Data SyncData Sync• PerformancePerformance
PerformancePerformance
• Performance by Database designPerformance by Database design• Query Processor Performance TipsQuery Processor Performance Tips• ADO.NET Performance TipsADO.NET Performance Tips
ResultSetResultSet
• Performance for Data SyncPerformance for Data Sync
SQL Mobile – Technical resources, Community & MVPSQL Mobile – Technical resources, Community & MVP
Product PageProduct Page :: http://www.microsoft.com/sql/ce/mobility/beta1.asphttp://www.microsoft.com/sql/ce/mobility/beta1.aspBOL and samples:BOL and samples: http://msdn.microsoft.com/SQL/SQLCE/default.aspxhttp://msdn.microsoft.com/SQL/SQLCE/default.aspxWebcastWebcast : : http://www.sqlservermobile.com/SQLMobileWebCastshttp://www.sqlservermobile.com/SQLMobileWebCastsWhite PaperWhite Paper : : Replication and RDA features Replication and RDA features
: Multi user access: Multi user accessNewsgroupNewsgroup : : microsoft.public.sqlserver.cemicrosoft.public.sqlserver.ceNewsgroupNewsgroup : : microsoft.private.whidbey.sqlmobilemicrosoft.private.whidbey.sqlmobileHands on LabHands on Lab : : Developing a SQL Mobile application with VS Developing a SQL Mobile application with VS 2005 and 2005 and SQL Server 2005 SQL Server 2005Developers conference :Developers conference : MEDC, TECHED etcMEDC, TECHED etcMSDN chatMSDN chat : : July 2005July 2005Other ResourcesOther Resources : . : .NET CF, VS, Win CE, SQL ServerNET CF, VS, Win CE, SQL Server
SQL Mobile – Technical ResourcesSQL Mobile – Technical Resources
Questions ?Questions ?
Q & A: Q & A: We want your feedback!We want your feedback!
Email: [email protected]: [email protected]: Blog:
http://blogs.msdn.com/gkhannahttp://blogs.msdn.com/gkhanna//
WWW: WWW: http://www.wintoolzone.com/http://www.wintoolzone.com/
© 2003-2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
SQL Mobile Data AccessSQL Mobile Data Access
Native StackNative Stack Managed StackManaged Stack
SQL Server Mobile EditionSQL Server Mobile Edition
CLR / .NET CFCLR / .NET CF
SQL Server CE SQL Server CE Data ProviderData Provider
ADO.NETADO.NET
VB .NET / C#VB .NET / C#VS 2005 C++VS 2005 C++
OLEDB CEOLEDB CE
OLEDB ProviderOLEDB Provider
QP / Cursor Engine / ESQP / Cursor Engine / ES
Storage Engine / Replication TrackingStorage Engine / Replication Tracking
SQL Mobile Synch SQL Mobile Synch EnhancementEnhancement
• Improved Sync ControlImproved Sync Control Multi-user syncMulti-user sync Progress notificationsProgress notifications Multiple Subscriptions in Multiple Subscriptions in
the same dbthe same db• SQL Workbench SQL Workbench
integrationintegration Improved Web Improved Web
Configuration WizardConfiguration Wizard New Subscription WizardNew Subscription Wizard Subsequent Sync SupportSubsequent Sync Support
• Sync PerformanceSync Performance Partitioned GroupsPartitioned Groups Dynamic Snapshots Dynamic Snapshots
(BCP)(BCP) Article Partition Article Partition
OptionsOptions Article Upload OptionsArticle Upload Options Column level trackingColumn level tracking
• SupportabilitySupportability Re-sync to restored Re-sync to restored
publisherpublisher Server Agent DiagnosticsServer Agent Diagnostics Server Agent StatisticsServer Agent Statistics
15 min summary15 min summaryPer client sync summaryPer client sync summary
Dr WatsonDr Watson
• OthersOthers Managed custom resolverManaged custom resolver Article OrderingArticle Ordering SQL 2K supportSQL 2K support Connection retry timeoutConnection retry timeout Compression levelCompression level
Performance – Database DesignPerformance – Database Design
• Smaller row lengthSmaller row length• Fixed and Variable length columnsFixed and Variable length columns• Key Length – SmallKey Length – Small• Normalization/DenormalizationNormalization/Denormalization• IndexesIndexes
Performance – QueriesPerformance – Queries
• Sub queries vs JoinSub queries vs Join• Parameterized QueriesParameterized Queries• Outer join – slow response Outer join – slow response • IndexesIndexes
What to indexWhat to index Selective IndexSelective Index Multiple Column IndexMultiple Column Index No index on small tablesNo index on small tables