Download The Mobile Architect

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Relational model wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Microsoft Access wikipedia , lookup

Database model wikipedia , lookup

PL/SQL wikipedia , lookup

Clusterpoint wikipedia , lookup

SQL wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Transcript
The Mobile Architect
Morgan Skinner
Agenda


Common Patterns and Designs
Architecting Mobile Applications






Synchronization
Web Services
SQL CE
MSMQ
Performance
Deployment
Common Patterns and
Designs



Document tested simple mechanisms
Provide common terminology for
architects and developers
Promote



Re-use
Flexibility
Cohesion
Defining SOA


Service-Oriented Architecture is an approach to
organizing information technology in which data,
logic, and infrastructure resources are accessed by
routing messages between network interfaces
Basic value proposition is to provide consistent,
stable interfaces in front of diverse or volatile
implementations



Establish context for information exchange across
organizations
Encapsulate complexity within organizations
Enable context-sensitive information processing
Microsoft’s Vision for SOA

Service orientation will encapsulate and
componentize processes and systems




Business capabilities and business processes will
be modeled as services



Help manage complexity
Permit controlled change
Support continuous improvement
Organizations will expose touchpoints into these
processes to both internal and extra-organizational actors
Allows automation of processes that have defied
automation until now
On the path to the Agile Enterprise
Three Tier
Pattern
Presentation Layer
Order Entry
Web Pages
Reporting
Web Pages
Order
Management
Reporting
Management
User
Management
ADO.NET
Order
Data Access
Reporting
Data Access
Business Layer
Data Access Layer
Service Orientated
Architecture
Presentation Layer
Order Entry
Web Pages
Security
Business Layer
Data Access Layer
Reporting
Web Pages
Service Interfaces
Order
Management
Reporting
Management
User
Management
ADO.NET
Order
Data Access
Reporting
Data Access
Services
Mobile Architectures

Need to address

Communication


Security





From device to server or device
Are communications secure?
Is data secured?
Performance
Deployment
All of the above can impact physical
and logical Designs
Server Applications
ASP.NET
HTML for Pocket IE
Mobile Web Pages
WML for WAP
Browsers





Supports large number of devices
Low cost deployment
Centralized logic
Online only
Browser user interface
Client Applications
Server
Web Services
MSMQ
HTTP Channel




Targets a Smartclient
Deployment required
Can work disconnected
Rich user interface
Online / Offline


Smartclient applications need to
support online / offline
Synchronization Options


One / Both ways
Application / Database level
Synchronization


Consider your applications requirements
Both Ways




Multi-user updates of data
Web Services
SQL CE Replication
One Way





Mutually exclusive data
Web Services
MSMQ
SQL CE Remote Data Access
SMS
Synchronization
Web
Services
Application
User Interface
UI
Application
Sync
Business Layer
Application Logic
Data Access Layer
SQL Server CE
Data
Sync
Application Sync
High reuse of logic
Slower synchronization
Data Sync
Fast synchronization
Low level of logic
Data collisions
Detecting Online /
Offline
Web Services

Synchronous



Asynchronous




Good for small, quick packets of data
Block the current thread
Good for larger packets of data
Callback when processing finished
Check for exceptions due to connectivity issues
Security




Recommended to use SSL
Digest or Clear Text authentication
Currently no support for WSE
Custom via SOAP headers
Web Services Considerations

Store and Forward




Web service requests cached
Executed when network available
Variable re-try algorithm
Data Compression


GSM data costs
Conserve bandwidth
Smart connected architecture
SmartClient Application
Custom WS Proxy
Network Test
WebRequestCompleted
Asynchronous
Timed Event
Order Service
Store and Forward
Store
Map Service
Web Service
Data Compression

Server side




Client side



Windows 2003 Server
Enable compression and gzip.dll via MMC
Modify metabase adding asmx to
HcScriptFileExtensions for gzip and
deflate compression filters
Need to override GetWebRequest and
GetWebResponse
.NET Compact Framework SP1
Client applications need some
additional coding to be able to exploit.
Client Data Compression
public class GzipProxy : SoapHttpClientProtocol
{
protected override WebRequest GetWebRequest(System.Uri uri)
{
WebRequest req = base.GetWebRequest(uri);
req.Headers.Add("Accept-Encoding", "gzip, deflate");
return req;
}
protected override WebResponse GetWebResponse(WebRequest
req)
{
return new CompressedHttpWebResponse(req);
}
}
Web Services
Store and Forward
DataSets





Supported by Web services
Typed DataSet unsupported
Serializable to XML
Missing Merge() and GetChanges()
Manual synchronization required
SQL Server CE 2.0






Runs on Pocket PC 2000+
Smartphone version coming
1.5MB memory footprint
Compact Framework Support
Authentication and Encryption
Connectivity


Remote Data Access - SQL7/2000
Merge Synchronization – SQL2000
Database Feature Set
Rich functionality for small footprint









Multi-column indexes
Referential integrity
Sub-selects (IN)
Defaults
Inner/outer joins
One file database
Null support
Unicode support
Transactions

Data-types






Real, Numeric, NVarChar,
NText, Image, Integer,
DateTime, VarBinary,
UniqueIdentifier, Money
Having/group by
Seek on index
Set functions
Identity attribute
Local security - DB
encryption (128bit) and
database password
CE Data Access
Storage Architecture
Enterprise Backend
Oracle / db2 / etc
.NET CF / Managed Stack
Native/Unmanaged Stack
eVB
3.0
ADO
CE
v3.1
ADO.NET
eVC
3.0
XML/BizTalk/CS 2002
VS .NET (VB.NET, C#)
SQL Server
CE Data
Provider
SQL Server
Client Data
Provider
CLR / .NET CF
Ethernet
TDS
Well
Connected
OLEDB CE
SQL CE Edition v2.0
Data Provider
OLEDB
QP/Cursor Engine/ES
OLEDB
Client
Agent:
Replication
and
RDA
Storage Engine / Repl
Tracking
802.11b,
CDPD,
GSM,
CDMA,
TDMA, etc.
IIS
HTTP
Occasionally
Connected
CLIENT
SERVER
OLEDB /
Replication API
Server
Agent:
Replication
and
Remote
Data
Access
Remote Data Access (RDA)
Remote Data Access (RDA)
Remote Data Access
Merge Replication


Based on SQL Server 2000 bidirectional implementation
Ideal for mobile use






Update data on client and/or server
Merge and resolve conflict based on
server-side rules
Easy synchronization when connected
Flexible data partitioning: vertical,
horizontal, and dynamic
Anonymous pull subscriptions
Auto Ranged Identity Support
SQL CE Replication
DataSet vs SQL CE
DataSet
SQL CE
Inbuilt to Compact Framework
Need to deploy
Extra runtime RAM requirement
Rich ANSI SQL support
Persists on filesystem
Remote data access and
synchronization over HTTP
Requires SQL Server
Large databases up to 2GB
Limited filter capability
Serializable to XML
Supports Web services
Works with .NET Runtime
Performance limited to smaller
data
No inbuilt security
128-bit Encryption support
Client Access Licensing
Microsoft Message Queue
Message Queue
MSMQ







Implements asynchronous
communications
Provides guaranteed delivery, efficient
routing, priority based messaging.
Usernames storage support roaming
NIC tracking
Transparent, salvageable storage
Small footprint ~150KB
Support for private queues only
Communication Options
Transport
Web Services
SQL CE
MSMQ
Summary
Internet Ready
Industry standards / High level of interoperability
Highly extensible
Application synchronization
Internet Ready
Designed for data manipulation
Synchronization Enabled
Can communicate to SQL Server
Secure
(Smartphone support coming)
Guaranteed delivery
Extension of backend MSMQ systems
Network tracking built in
(Managed support coming)
Other Considerations

Performance




Raw Application
Perceived Response
Backend Servers
Security & Deployment

See Securing and Deploying your Mobile
Application
Performance - WinForms

Load and cache Forms in the background

Populate data separate from Form.Show()



Parent controls top-down


Pre-populate data, or
Load data async to Form.Show()
e.g. Form  panels  controls
Keep event handling code tight


Process bigger operations asynchronously
Blocking in event handlers will affect UI
responsiveness
Performance - XML

Use XmlTextReader and XmlTextWriter



Smaller memory footprint than using
XmlDocument
XmlTextReader is a pull model parser
which only reads a “window” of the data
Design XML schema first, then code


Understand the structure of your XML
document
Use elements to group


Allows use of Skip() in XmlTextReader
Use attributes to reduce size
Performance - Data

If data is local…instead of DataSet…



Leverage SQL CE native in-proc database
Query data using DataReader
Use TableDirect command type for fast index searches


Limit open SqlCeCommand/DataReaders


Equivalent to “SELECT * FROM foo”
Dispose when complete
If data is remote…


Use SQL CE replication
When using Web Services


Save data locally in SQL CE for faster access and storage
Don’t save remote DataSets as XML to device

If you do, save Schema as well
Performance - Server




Aggregate multiple Web service calls
where possible
Stress test the server, find your limits
Implement stateless calls for web
farms
For large user base, partition times
users can replicate SQL data
Deployment
Considerations

Installation

CAB format for installation







Desktop ActiveSync
Web page URL
Email
Service Indication / Service Loading Messages
SD/CF Card
What is user base?
Ongoing

How to ensure users are running latest
versions?
Summary


Store and Forward connectivity can help
connected/disconnected environment
Web Services



SQL CE



Designed for data manipulation
Secure
MSMQ



Standardised
Extensible
Extension of backend MSMQ systems
Guaranteed delivery
Design with performance in mind
Resources

Patterns & Practices
http://www.microsoft.com/resources/practices/

.NET Compact Framework FAQ
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/
default.aspx

SharpZipLib Compression Library (note licensing)
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.a
spx

IIS 6.0 HTTP Compression
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/p
rodtechnol/windowsserver2003/maintain/operate/iis6perf.asp

SQL CE and SQL 2000 sp3a
http://www.microsoft.com/sql/ce/downloads/sp3.asp

MSMQ
http://msdn.microsoft.com/msdnmag/issues/01/12/MSMQCE/default.aspx
© 2003-2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.