dongmei2957 2013-04-14 14:11
浏览 46
已采纳

如何从外部网站连接到Azure的数据存储?

I'm new to the whole idea of cloud programming to store information connected to mobile/web/applications. I've been reading through tutorials and Microsoft seems to have done a good job tying everything together and making it fairly simple to adapt for your purposes.

However, all tutorials assume you will be using every aspect of your application from Microsoft's Azure (website, mobile services, data storage, database etc.).

I'm wondering if anybody knows of an example I can use to see how to connect an external website (one not hosted on Microsoft Azure) to their Data Storage (on Azure)? What do the connection strings look like? Most importantly, how do you add the libraries/classes to the external server?

i.e.

  • user makes changes to record/entity on www.example.com (php)
  • www.example.com connects to data storage on Windows Azure
  • record/entity is update/inserted

It seems like there should be a fairly easy solution to this, or maybe I'm missing something?

Thanks for any help!

  • 写回答

1条回答 默认 最新

  • douhao5280 2013-04-14 14:21
    关注

    Microsoft's cloud offering (Azure) consists of different components which can be used to store data.

    SQL Azure databases behave just like every other MS SQL Server database. Their scalability and flexibility is completely abstracted and you should be fine using any PHP+MSSQL sample or the normal documentation. In terms of connection strings: They also work as expected and for most scenarios you do not have to do anything different. This minimal sample shows how to use SQL Azure from PHP. You can just ignore the first part setting up the Azure application. You should be able use the same php code snippet from any other hosting scenario (e.g. Apache+PHP on Linux). If you have issues connecting you might want to have a look at the allowed ip addresses configuration of your server in the Azure management portal and allow the IP of your external server/hoster.

    Azure storage (Blobs, Queues, Tables) are basically simpler means of storing data. You can use it through the azure sdk for php and have a look at the samples. Most of this article should apply to your scenario as well. Storage is cheaper for many scenarios compared to using a SQL database.

    So to sum up: You don't have to to anything "special" for your scenario. Just use SQL Azure like any other database. Simply store files in Azure blobs.

    As for any application spanning multiple data-centers: Be aware of latency. Round-trips to the database/storage will be more expensive (in terms of performance) than when hosting everything at one site. This can be a significant performance bottleneck depending on your application.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥20 为什么我写出来的绘图程序是这样的,有没有lao哥改一下
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号