简体   繁体   English

BigQuery:写后读一致性(流式插入)

[英]BigQuery: Read After Write Consistency (Streaming Inserts)

As the title states, what is the consistency guarantee for BigQuery with respect to streaming inserts?如标题所述,BigQuery 在流式插入方面的一致性保证是什么? Will I be able to guarantee a consistent read after inserting rows using streaming insert?使用流式插入插入行后,我能否保证读取一致?

Yes and no!!是与否!!

  • Yes, the read is consistent if you get your data just after the streaming insert!是的,如果您在流式插入之后立即获取数据,那么读取是一致的!
  • No if you use partitioning because the streaming data are stored in a buffer and it can take up to 2h to BigQuery to store the data in the correct partition.如果您使用分区,则不会,因为流数据存储在缓冲区中,BigQuery 最多可能需要 2 小时才能将数据存储在正确的分区中。

So, it depends on how you use your data.所以,这取决于你如何使用你的数据。

It depends on which Streaming API you are using and which DML you expect to run:这取决于您使用的是哪个 Streaming API 以及您希望运行哪个 DML:

So in general terms, when using default streaming, data is promptly available for reading queries after an acknowledged streaming insert.因此,一般而言,当使用默认流式传输时,在确认流式插入后数据可立即用于读取查询。

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

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