Windows Azure 持久存储技巧
我刚刚激活了我的 Azure 帐户,创建了第一个 Asp Mvc 3.0 项目(只是模板)并部署了它:)。太棒了
但是我即将创建一个小应用程序(只是为了学习Azure)并且遇到了一个小问题。 这就是我想做的: 创建一个 mvc 应用程序,显示我的音乐库并允许搜索、排序、添加新专辑等。 大概有大约 3000 张专辑。
我应该使用哪种存储,有人知道关于如何使用 mvc 在 C# 中执行此操作的好教程示例吗?
请注意,我不想使用 SQL Azure,那太简单了。我需要深入学习 blob/table/?类型。
我只需要一个关于我应该开始学习哪种存储类型的合理建议,更重要的是我应该在哪里学习:)。
Ive just activated my Azure account, created ny first Asp Mvc 3.0 project (just the template) and deployed it :). Wonderfull
However im about to create a small app (just to get to learn Azure) and have hit a minor issue.
Heres what i want to do:
Create an mvc app which displays my music library and allow for searching, sorting, add new albums, etc.
Theres proberbly about 3000 albums.
What kind of storage should i use and does anyone know of a good tutorial example about how to dó this in c# with mvc?
Please note i dó not want to use SQL Azure, that would be to easy. I need to dig in and learn blob/table/? Types.
I just need a Sound recomendation on which storage type i should start studying, and more importantly where i should study it :).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Azure 存储表与 SQL 不同,它们由 Azure 而不是 DBMS 管理。它们有一个 Key 字段,通过它您可以找到表中的数据,并且可以使用 LINQ 来访问它。也就是说,在选择每个数据的去向时应该考虑性能。 SQL Azure 应该提供更好的关系访问,因此如果您将拥有大量表并期望进行大量联接操作,我会选择它。但是,如果您使用需要在应用程序中维护的简单结构化数据,则可以选择表。
当然,由于存储比 SQL Azure 便宜 10 倍,因此您始终希望设计能够充分利用存储的应用程序,但请记住检查可能存在的任何性能问题。
Azure Storage Tables are different from SQL in which they are managed by the Azure and not by a DBMS. The have a Key field through which you can find data within the table, and you can use LINQ to access it. That said, there should be performance considerations when choosing where each data would go. SQL Azure should provide better relational access, so if you are going to have a high number of tables and expect a lot of joins operations, I'd go with it. But, if you are using a simple structured data that you need to maintain in your application, you can choose tables.
Of course, since storage is 10x cheaper than SQL Azure, you will always want to design applications that make good use of storage, but remember to check for any performance issues you might have.
Windows Azure 平台培训Kit 在“探索 Windows Azure 存储”下有一些实验室。这应该可以让您开始理解表和实体方法。特别注意分区键和行键。存储经过优化,可以围绕分区键共置,并通过行键在分区内建立索引。您需要仔细规划用于搜索的行键。如果您需要搜索表中的多个属性,则需要考虑其他表(每个表包含您要搜索的行键),或者可能是 NoSQL 数据库,如 MongoDB(或关系数据库,如 SQL Azure、但你说你想避免这种方法)。
另外,请查看这篇博客文章作者:David Pallman - 他针对每种类型的存储操作都有一套完整的代码片段。当您尝试找出与表存储交互的所有方法时,这可以为您节省很多时间。
然后,查看此 MSDN 帖子,讨论存储事务,当您超越简单示例并将焦点转移到生产代码时,这将是相关的。
The Windows Azure Platform Training Kit has a few labs, under Exploring Windows Azure Storage. That should give you a good start understanding the table and entity approach. Pay specific attention to partition and row keys. Storage is optimized to be colocated around partition key, and indexed within a partition via row key. You'll need to carefully plan your row key for searching. If you need to search on multiple properties within a table, you'll need to consider either additional tables (each containing a row key that you'd search), or maybe a NoSQL database like MongoDB (or a relational database like SQL Azure, but you said you want to avoid that approach).
Also, take a look at this blog post by David Pallman - he has a complete set of code snippets for every single type of storage operation. This could save you many hours of time as you try to figure out all the ways to interact with Table Storage.
Then, look at this MSDN post that talks about storage transactions, which will be relevant when you move beyond simple examples and shift focus into production code.