Cloud Standards
Get DisConnected on the Cloud with WCF Data Services
SQL Azure Data Access Patterns
Jan. 11, 2011 08:45 AM
Connected and DisConnected Data Access Patterns
In multi-tiered applications, the EIS Tier (Enterprise Information Systems) is the last in the sequence, and how efficiently it is accessed is key to the performance and scalability of the system.
Connected Access Pattern: A user or an application is constantly connected to a data source until it is operating on the data, i.e., the client deals with the data present on the server without keeping any local copy of the data.
Some of the implementations of the Connected Access Pattern are:
- CURSORS in Databases
- JDBC Result Set and equivalent implementations in JPA (Java Persistent Architecture)
DisConnected Access Pattern: A user or an application is not constantly connected to a data source until it is operating on data, i.e., the client stores a copy of the data taken from the server in a local cache. All the operations are done on this local copy and finally changes are made on the server in one go with the final copy.
Some of the implementations of the DisConnected Access Pattern are:
- ADO.net Implementation
- Service Data Object (SDO) Implementation
Cloud and DisConnected Architecture
The following points emphasize how the DisConnected architecture is most suitable to cloud-based implementations:
- Database instances reside on Virtual Servers and by theory Virtual Servers can be migrated to a cloud platform and thus there is no guarantee that a long-running transaction will find the same database connection to complete the transaction.
- In a multi-tenant SaaS model, the potential of locking the tables and rows is high when we adopt a connected model, and a disconnected model ensures that the database is minimally locked on an optimistic approach.
- PaaS platforms for a database such as Amazon RDS naturally implement Web service calls for DB access, making it automatically support the disconnected architecture.
SQL Azure
The SQL Azure Database provides a cloud-based database management system (DBMS). This technology lets on-premises and cloud applications store relational data on Microsoft servers in Microsoft data centers. As with other cloud technologies, an organization pays only for what it uses, increasing and decreasing usage (and cost) as the organization's needs change. Using a cloud database also allows converting what would be capital expenses, such as investments in disks and DBMS software, into operating expenses.
WCF Data Services
WCF Data Services enables the creation and consumption of data services for the Web or an intranet by using the Open Data Protocol (OData). OData enables you to expose your data as resources that are addressable by URIs. This enables you to access and change data by using the semantics of the representational state transfer (REST), specifically the standard HTTP verbs of GET, PUT, POST, and DELETE.
SQL Azure data can be exposed as WCF Data Services by using the Entity Framework provider. The WCF Data Service framework provides an API that allows data to be created and consumed over HTTP using a RESTful service. All the database operations can be exposed as a service in this manner.
The Visual Studio development tool provides an easy interface to create an entity data model, and the created data service can be deployed on a Azure Platform on Cloud.
As HTTP-based RESTful services are used as an access mechanism, WCF Data Services naturally provide a DisConnected data architecture for cloud-based databases such as SQL Azure.
The following figure, the courtesy of the vendor, shows the disconnected architecture of WCF Data Services.

Summary
Tight coupling of the data access with the rest of the layers makes it inefficient in multi-tiered application and this is even more evident with cloud-based data access. WCF Data Services provides a perfect solution for data access for a cloud database such as SQL Azure.
About Srinivasan Sundara RajanSrinivasan Sundara Rajan works at Gavs Technologies as a Chief Architect. His primary focus is enabling Agile Enterprises by facilitating the adoption of Every Thing As A Service Model with particular concentration on BpaaS (Business Process As A Service). Srinivasan is currently writing a series of articles on Indutry SaaS/BpaaS use cases which enterprises can adopt.All the views expressed are Srinivasan's independent analysis of industry and solutions and need not necessarily be of his current or past organizations. Srinivasan would like to thank every one who augmented his Architectural skills with Analytical ideas.