When the application reads an entity, that entity is automatically cached; this gives fast (and inexpensive) reads for frequently-read entities.
...
The NDB function that writes the data (for example, put()) returns after the cache invalidation; the Apply phase happens asynchronously.
在 Youtube 上观看,Google I/O 2011: More 9s Please: Under The Covers of the High Replication Datastore ,在 13:11 左右,平均延迟为:
Master/Slave:
- Read: 15ms
- Write: 20ms
High Replication:
- Read: 15ms
- Write: 45ms
从应用的角度来看,NDB 对这些速度的影响有多大?
编辑:特别好奇时间统计(以毫秒为单位)。
额外信用:我还听说 Nick Johnson 提到每个查询花费大约 160 毫秒(2009 年)[link]
NDB 是否提供任何查询速度优势?
最佳答案
您必须自己进行基准测试——时间取决于许多因素,例如实体大小和复杂性:更多属性或重复属性中的更多项 -> 更复杂。
你引用的数字真的很旧,可能不再反射(reflect)现实;大多数用户的体验是,平均而言,HRD 并不比 M/S 慢(部分原因是 M/S 具有更高的可变性)。
这里有一些 NDB 基准测试:http://code.google.com/p/appengine-ndb-experiment/issues/detail?id=118 -- 但它不会将数字与旧数据库进行比较。
您可以使用 Appstats 在真实应用中快速执行一些操作计时。
关于google-app-engine - NDB 与 DB(在高复制数据存储上)的速度比较是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9953789/