2008年11月21日星期五

接触Azure Services Platform

原来等待一个邀请码的时间也能如此漫长,在等待了二周之后终于收到了Azure Services Platform的邀请码。说是等待其实不准确,我本以为系统出错或者忽略了我的申请,已经没有期待。另外,收到的邀请码是针对Microsoft .NET Services和Microsoft SQL Services的,印象中我申请的是Live Services,本打算是拿Live的服务接口在自己已经废弃的MSN Spaces上面做点事情。

Azure是微软于今年十月发布的云计算平台,所谓的“云里雾里的计算”,同样的东西Amazon和Google已经先行了。Amazon的没有了解过,Google的那一套在Google Code上可以获取,曾经瞄过一眼,开发语言是Python。而眼下Azure仍然使用的托管类语言,需要开发者在.NET上进行开发。下面这张图简单展示了Azure的服务架构。



Greetings from the Azure Services Platform Team!

Your invitation code for Microsoft® .NET Services and Microsoft® SQL Services is now activated! You can sign up for Microsoft .NET Services and Microsoft SQL Services at http://go.microsoft.com/fwlink/?LinkID=129428. Your invitation code is valid only for signing up one .NET Services and SQL Services solution and was sent to you previously with title "!!Do Not Delete!! Invitation Code to Microsoft .NET Services and Microsoft SQL Services".

If you encounter any on-boarding issues, please post your questions to our forum (http://go.microsoft.com/fwlink/?LinkID=129447)

Sincerely,
Jenny Lo
Azure Services Platform Team


收到了上面的邮件,表示我的邀请已经被激活,可以开始体验Azure了。登录之后新建了一个服务,然后去下载了Microsoft .NET Services (Nov 2008 CTP) SDK。目前Azure云计算平台提供的.NET Services和SQL Services提供了如下的功能:

SQL Data Services
Logo
Microsoft SQL Data Services (SDS) offers highly scalable and Internet-facing distributed database services in the cloud for storing and processing relational queries. SDS can help you develop and provision new applications quickly with REST and SOAP based web protocols.

Service Bus
Logo
Service Bus provides a hosted, secure, standards-based infrastructure that dramatically reduces the barriers for building federated solutions that require communicating across Internet-distributed systems and organizational boundaries.

Workflow Service
Logo
The Workflow Service is a hosted offering that executes user defined declarative workflows in a scalable and reliable manner, greatly simplifying the need to write complex code to orchestrate the interactions between services.

Access Control Service
Logo
The Access Control Service provides hosted claims based access control using powerful, secure, standards-based infrastructure and federates with existing identities. The Access Control Service provides authorization for the Services Bus, Workflow and SQL Services.

读过一万篇文章也不如实际去运行一个最简单的“Hello World”,此前我一直迷惑云计算的服务开发人员的代码是放在哪里运行的,在跑了SDK中提供的最简单的Sample之后我明白了。Azure Service的开发和配置风格与Windows Communication Foundation是类似的,安装SDK后,添加了一种新的绑定netTcpRelayBinding,“Relay”是关键词,暗示了请求/响应的传递方式。

这个Sample提供的身份验证是简单的Username/Password的模式,用户名是我建立的服务Solution的名称,密码则是该Solution的密码,在运行服务端和客户端的时候都要输入,完成在云端的验证。Sample的功能也很简单,网络编程中最基础的Echo。


运行在本地机器上的服务端/客户端

当关闭服务端控制台时,客户端无法得到服务端的响应,说明Service Bus其实起到了一个桥接的作用(“Relay”),服务端程序无论运行在怎样的网络环境下,无论是在NAT之内还是公共环境,也不在乎这个服务的IP如何更改,客户端对其的定位依赖于Azure的Service Bus提供的统一地址,Service Bus为服务提供了注册与地址解析。在本例中,Echo服务的地址始终是“http://servicebus.windows.net/services/KwanService/EchoService/”,该服务的实际网络环境和地理位置,对客户机是完全透明的。

目前Azure的服务器只设置在美国,从实际使用Sample的情况来看,即便是教育网也能比较顺畅地完成通信过程,验证过程稍慢,多次尝试的速度不够稳定(时快时慢),不过服务端和客户端的通讯还是很流畅的。目前社区还提供了跨平台的RubyJava的SDK,其他语言的支持也在开发中。

没有评论:

发表评论