使用高复制数据存储+ NDB进行写入/读取 [英] Write/Read with High Replication Datastore + NDB

查看:117
本文介绍了使用高复制数据存储+ NDB进行写入/读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我最近一直在阅读关于HRD和NDB的大量文档,但我仍然对NDB如何缓存内容有所怀疑。
$ b

示例案例:假设一个用户写入数据的情况,并且应用程序需要在写入后立即获取数据。例如。用户创建组(类似于Facebook / Linkedin组),并在创建后立即重定向到组。 (现在,我创建了一个组,并且没有将其分配给祖先)

结果:



在本地测试此类功能时(启用高复制),新创建的组的立即获取失败。返回NoneType。



问题:



docs和Google IO视频,我知道写入延迟较高,但是,NDB缓存不应该考虑这一点吗?即写缓存,然后异步实际写入磁盘,因此,立即读取将从缓存读取,因此应该没有问题。我需要执行一些其他设置吗?

解决方案

很确定您正在运行HRD功能,其中查询最终一致 。 NDB的缓存与此行为无关。


So I have been reading a lot of documentation on HRD and NDB lately, yet I still have some doubts regarding how NDB caches things.

Example case:

Imagine a case where a users writes data and the app needs to fetch it immediately after the write. E.g. A user creates a "Group" (similar to a Facebook/Linkedin group) and is redirected to the group immediately after creating it. (For now, I'm creating a group without assigning it an ancestor)

Result:

When testing this sort of functionality locally (having enabled high replication), the immediate fetch of the newly created group fails. A NoneType is returned.

Question:

Having gone through the High Replication docs and Google IO videos, I understand that there is a higher write latency, however, shouldn't NDB caching take care of this? I.e. A write is cached, and then asynchronously actually written on disk, therefore, an immediate read would be reading from cache and thus there should be no problem. Do I need to enforce some other settings?

解决方案

Pretty sure you are running into the HRD feature where queries are "eventually consistent". NDB's caching has nothing to do with this behavior.

这篇关于使用高复制数据存储+ NDB进行写入/读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆