简体   繁体   English

Event Hub旨在用于事件源/仅附加日志体系结构

[英]Is Event Hub's intended to be used for Event Sourcing / append-only log architectures

Event Hubs don't let you store messages longer than 7 (maybe up to 30) days. 事件中心不允许您存储超过7天(可能长达30天)的邮件。 What is Azure's suggested architecture for PaaS Event Sourcing with these limitations? Azure建议的PaaS事件采购架构有哪些限制? If it's Event Hub + snapshotting, what happens if we somehow need to rebuild that state? 如果它是Event Hub +快照,如果我们以某种方式需要重建该状态会发生什么? Additional, is Event Hub's answer to KSQL/Spark Azure Stream Analytics? 另外,Event Hub对KSQL / Spark Azure Stream Analytics的回答是什么?

Great Question! 好问题!

Yes, EventHubs is intended to be used for Event Sourcing or Append-only log pattern. 是的, EventHubs旨在用于Event SourcingAppend-only log模式。 EventHubs can be used as source/sink for stream processing & analytics engines like SPARK and hence not its competitor. EventHubs可用作流处理和分析引擎(如SPARK)的源/接收器,因此不是其竞争对手。 In general, EventHubs offers similar capabilities as that of Apache Kafka. 通常,EventHubs提供与Apache Kafka类似的功能。

& Yes, to implement rebuilding transactions from the append-only log Snapshotting is definitely the recommended approach! 是的,从仅附加日志实现重建事务Snapshotting绝对是推荐的方法!

While shaping EventHubs as a product offering, our considerations for assigning a default value for retentionPeriod - were - 在将EventHubs塑造为产品时,我们考虑为retentionPeriod分配默认值 - 是 -

  • most of the critical systems create snapshots every few minutes. 大多数关键系统每隔几分钟就会创建一次快照。
  • most of the design patterns around this suggest retaining older snapshots for rebuild 围绕此建议的大多数设计模式建议保留较旧的快照以进行重建

So, it was clear that we don't need infinite log, & a timebound of a day will do for most use-cases. 因此,很明显我们不需要无限的日志,并且一天的时间限制将适用于大多数用例。 Hence, we started with a default 1 day - and gave a knob until 7 days. 因此,我们开始默认1天 - 并给了一个旋钮直到7天。

If you think, you would have a case, where you will have to go back in time for >7 days to rebuild a snapshot (for ex: for debugging - which is generally not a 99% scenario - but, agreed that designing & accommodating for this is very-wise), recommended approach is to push the data to an archival store. 如果您认为,您将有一个案例,您将需要及时返回> 7天来重建快照(例如:用于调试 - 通常不是99%的情况 - 但是,同意设计和适应对于这是非常明智的),推荐的方法是将数据推送到档案商店。

When our usage Metrics showed that many of our customers have one EventHubs consumer group dedicated for pushing data to archival store - we wanted to enable this capability out-of-the-box & then started to offer - Event Hubs Capture feature . 当我们的usage Metrics显示我们的许多客户都有一个致力于将数据推送到档案商店的EventHubs consumer group - 我们希望开箱即用,然后开始提供 - Event Hubs Capture功能

More on Event Hubs. 有关事件中心的更多信息。

Event Hubs are supposed to be used for temporarily storing events while moving them between the data storage instances. 事件中心应该用于在数据存储实例之间移动事件时临时存储事件。 You would have to load them to some permanent storage to use for indefinite time period, eg Cosmos DB. 您必须将它们加载到某个永久存储器以便无限期使用,例如Cosmos DB。

KSQL is somewhat comparable to Azure Stream Analytics. KSQL在某种程度上可与Azure Stream Analytics相媲美。 Spark is a much more broad product, but you can use Spark to process Event Hubs data. Spark是一个更广泛的产品,但您可以使用Spark来处理事件中心数据。

PS I'm not an official speaker of Microsoft, so that's just my view. PS我不是微软的官方发言人,所以这只是我的看法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM