c# - azure : data storage with append

标签 c# azure azure-storage azure-blob-storage

我计划在 Windows Azure 上运行数值模拟。模拟可能需要几天或几周的时间。每隔一秒左右,模拟就会产生一组数字,例如温度:double压力:double速度:double[]等。想要存储。

要求是:

  1. 立即保存每秒生成的所有数据,最好是在一个请求中保存。
  2. 即使在数值模拟运行时也能够读取任何存储的数据(例如使用 JavaScript)。
  3. 将温度、压力、速度等分开。我想读例如一次调用即可显示所有压力,无需读取速度等。
  4. 在全局层面上,存储应分为项目,项目应包含温度"file"、压力"file"等,每个"file"应包含一系列数字。
  5. 应该很便宜。
  6. 我不需要任何高级功能 -> 它应该或多或少像文件系统中的文件一样运行

我应该使用哪个存储?您能给我指出一个讨论此类用例的教程吗?

最佳答案

我的建议是为您的项目使用 Azure 表存储。它非常便宜,并且能够存储大量数据。

达到具体要求:

To save all the data produced every second immediately and preferably in one request.

您可以使用Entity Group Transactions将数据存储在一个请求中。这有一些限制,所以我建议您仔细阅读。

To be able to read any of the stored data (using e.g. javascript) even during the numerical simulation runtime.

由于 Windows Azure 表存储是基于 REST 的服务,因此您也可以使用 JavaScript 获取数据,尽管我实际上建议使用 Shared Access Signatures用于查询数据,因为它更安全。

To have temperature, pressure, velocity etc. separate. I would like to read e.g. all the pressures in one call without reading velocities etc.

On a global level, the storage should be split into projects and the projects should contain temperature "files", pressure "files" etc. and each "file" should contain a sequence of numbers.

这就是事情变得有趣的地方。基本上,您要做的就是对数据进行反规范化,而 Azure 表存储就是为此目的而设计的。你所说的"file",我称之为“表”。所以就会有“温度”表和“压力”表等等。我建议的方法是,当您第一次收集消息时,将数据保存在 Windows Azure 队列中,然后让另一个进程(可能是辅助角色)拉取此消息,并通过转换所需的数据将数据推送到不同的表中对于每个表。

It should be cheap.

Windows Azure 表存储很便宜。您基本上为存储的数据量、针对服务执行的事务数量以及流出数据中心的数据付费。请访问Windows Azure Pricing页面了解更多详情。

I do not need any advanced features -> it should behave more or less as files in the file-system

Azure 表存储本质上是一个基于键值对的数据存储,因此相对易于使用。

注意事项

Azure 表存储与常规 SQL 表略有不同,因为您无法在表上创建其他索引(称为二级索引)。您只能在表上获得单个索引(在 PartitionKey/RowKey 上)。因此,非常重要的是,您必须考虑如何从表中读回数据,非常明智地选择“PartitionKey/RowKey”值。

您可能会发现这些链接很有用:

http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/04/windows-azure-s-flat-network-storage-and-2012-scalability-targets.aspx

http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx

http://channel9.msdn.com/Events/Build/2012/4-004

Design of Partitioning for Azure Table Storage

关于c# - azure : data storage with append,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16711544/

相关文章:

c# - 使用相同的事件处理程序处理多个事件

reactjs - 如何在 React.js 中正确设置 Azure Media Player?

azure - 为什么我的自定义 VM 镜像未显示在 Azure 创建 VM 界面中?

visual-studio - VSTS 发布管理转换 web.config

当时间租赁时间超过 1 分钟时,Azure Blob 存储获取租赁会引发错误

c# Azure无法设置blob层

azure - 在 HDInsight 中添加 Azure 政府存储帐户

c# - 如何检查 DataGridView 中是否存在列

c# WinForm - 如何使用对话框表单请求凭据?

c# - ASP.NET Core 应用程序不从输出目录中读取 appsettings.json,而是从项目一中读取