所以快速更新我为什么创建这个问题。
目前,我们将设备的遥测数据存储在 Azure SQL Server 的现场。这很好用(在 EF、LINQ 和关系数据库方面有大量经验)但我知道这很可能不是最好的解决方案,尤其是对于存储“大”数据(数据现在仍然很小,但会在一年内增长) )。
我选择 DocumentDB 作为我们可能的解决方案来存储我们的事件历史。其余的将留在 SQL 中——用户、配置文件、设备信息、SIM、车辆等,因为我不想完全停止开发,因为我们将 100% 转移到 docdb,而只是做最好的短期 - 成本 + 性能。
通过这个视频,我终于想出了一个关于如何存储遥测数据的可能解决方案 - https://www.youtube.com/watch?v=-o_VGpJP-Q0 他们推荐每个时间段一个文档(示例使用 1 个小时)。这仍然是推荐的方法吗?
[Index]
public DateTime TimestampUtc { get; set; }
public DateTime ReceivedTimestampUtc { get; set; }
[Index]
public EventType EventType { get; set; }
public Guid ConnectionId { get; set; }
public string RawEventMessage { get; set; }
[Index]
public Sender Sender { get; set; }
[Index]
public Channel Channel { get; set; }
public DbGeography Location { get; set; }
public double? Speed { get; set; }
public double? Altitude { get; set; }
public Int16? Heading { get; set; }
public Byte? HDOP { get; set; }
public Byte? GPSFixStatus { get; set; }
public Byte? GPSFixType { get; set; }
public string Serial { get; set; }
public string HardwareVersion { get; set; }
public string FirmwareVersion { get; set; }
public string Relay1 { get; set; }
public string Relay2 { get; set; }
public string Relay3 { get; set; }
public string Ign { get; set; }
public string Doors { get; set; }
public string Input1 { get; set; }
public string Input2 { get; set; }
public string Out1 { get; set; }
public string Out2 { get; set; }
public int V12 { get; set; }
public int VBat { get; set; }