Recently, SQL Data Services (SDS) were published as a Community Technical Preview (CTP).Â
Registering via Microsoft Connect, Iâ€™ve been able to start building a sample application which is designed to make use of SDS for online real-time queries.
This blog entry forms part of the [MiniProject] documentation â€“ the Mini Project uses SDS for online storage and SQL Server Compact Edition 3.5 (SP 1) for offline storage.
As part of Microsoftâ€™s Cloud Computing strategy, SQL Data Services are envisioned to provide lightweight data storage and services for Internet-enabled applications.
Predominantly, SDS utilizes three different data access methods (Browser, REST and SOAP) and incorporates a tri-level data containment model (the â€śACEâ€ť concept) comprising of an Authority, a Container and an Entity.
Naturally, an Authority can contain multiple containers, and a container can contain multiple entities.
Source: SDS Reference
Getting Started with SDS
The first step is to register for SQL Data Services.Â
You need a Windows Live ID account, and need to register with Microsoft Connect.Â
Once youâ€™ve set both up (and signed in to Windows Live), a simple visit to this link will allow you to register for the SDS CTP.
Once you get emailed an invitation token (or obtain one from elsewhere) youâ€™re ready to start working with SQL Data Services.Â
Notice, once youâ€™ve registered in Windows Connect, a project is added to your Connect Dashboard, as below.
Browse to http://portal.ex.azure.microsoft.com/ where you will be prompted for your invitation code (which you most likely will receive via email).
Once you have entered your code you will land on the getting started page.Â Click the â€śCreate a New Solutionâ€ť button to get started.
Understanding SDS Data Containers
An Authority is a top level container used to uniquely identify a service authority.Â It is also a DNS name, and forms the base of a URI (e.g. https://my-authoprity.data.database.windows.net).
In the world of SDS, an Authority is created by a solution and a solution is created by a registered user (Windows Live Account).
A container can be thought of as a Table (as in the traditional database world)Â or as a grouping (a container which holds different entities, unlike a traditional database table).
In other words, you may use a container to only hold one type of entity (but use different containers to store different entities, like in todayâ€™s databases) or you can put many different kinds of entities into a container, itâ€™s entirely up to you.
Important note: at present, cross-container joins are not supported, so if you plan to write complex queries, or to link different entities together, youâ€™ll pretty much have to put all those entities into the same container.
Design note: Itâ€™s important to know that entities can not share Id values within the same container.Â See more in the section below regarding Entities.
Stored within a container, an entity has a basic definition which contains certain common properties.Â An entity can also be used to store a Dictionary-like set of key/value pairs, allowing an entity to store more specific information, according to your own definition.
Common Properties (Metadata Properties)
- Id (unique within the container),
- Kind (string defining the user defined entity type), and,
- Version (used for concurrency).
In addition to the metadata properties, an entity can also have zero or more additional flexible properties. These flexible properties can have any name and any scalar value of one of the scalar types listed below.
Supported Data Types (v1.0)
Limitations on data storage are listed here.
Web Browser Access
Authorities can be accessed via a web browser using the following syntax:
Once authenticated (if using Basic Authentication, this is the solution name accompanied by the solution password), the browser will render the following XML:
<s:Authority xmlns:s="http://schemas.microsoft.com/sitka/2008/03/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema"> <s:Id>[Authority Name]</s:Id> <s:Version>XXX</s:Version> </s:Authority>
This article should get you up and running, and give you a basic knowledge of SQL Data Services.
Check back for the second part, which will introduce you to the concepts behind getting data into SDS and more advanced topics.
- Create a container
- Create entities
- Query entities
As always, you can email me at email@example.com if you have any pressing questions.