简体   繁体   English

Google-app-engine NDB

[英]Google-app-engine NDB

With the recent release of NDB , is there any reason to keep using the old datastore API? 随着最近发布的NDB ,有没有理由继续使用旧的数据存储区API?

I'm working on an application that currently uses the old datastore API, and I have put quite some effort into caching objects in memcache. 我正在开发一个当前使用旧数据存储区API的应用程序,我已经花了很多精力来缓存memcache中的对象。 Am I correct in my understanding that, by changing to NDB, I can remove my custom caching, and still preserve my current performance? 我的理解是正确的,通过更改为NDB,我可以删除自定义缓存,并保持当前的性能吗?

Furthermore, does NDB in any way change the need for sharding counters? 此外,NDB是否会以任何方式改变对分片计数器的需求? Is the limit of 5 writes per second to an entity(group) in some way changed in NDB? NDB中以某种方式更改了实体(组)每秒5次写入的限制吗?

EDIT 编辑

Given that my application is still under development and I have no entities that I cannot easily delete, is there something I should consider before changing to NDB, or would it be as easy as just changing db.Model to ndb.Model ? 鉴于我的应用程序仍在开发中,并且我没有不能轻易删除的实体,在更改为NDB之前是否应该考虑一些问题,还是只需将db.Model更改为ndb.Model

The main reason to keep using the old API is for legacy applications. 继续使用旧API的主要原因是遗留应用程序。 The NDB API is not entirely the same as the existing DB API, so you'll need to make changes to your code to use it. NDB API与现有的DB API并不完全相同,因此您需要对代码进行更改才能使用它。 You're correct that you won't need to use your own caching code any longer, at least for get operations - if you're caching the results of queries, it will still be useful to keep that code. 你是正确的,你不再需要使用自己的缓存代码,至少对于获取操作 - 如果你缓存查询结果,保留代码仍然是有用的。

NDB doesn't provide any means to get around the need to shard counters if you want to use high write rates on them. 如果你想对它们使用高写入率,NDB不提供任何方法来解决分片计数器的需要。

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

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