数据存储区中的Google App Engine版本控制 [英] Google App Engine Versioning in the Datastore
问题描述
http://1.my-app-name.appspot.com
, http://2.my-app-name。 appspot.com
。 这个应用程序的哪些方面实际上是版本化的?它只是Python +静态文件的代码库吗?数据存储是否具有版本的概念?如果没有,那么当我更新Google App Engine模型的定义时会发生什么?
谢谢!
正确的应用版本仅适用于您上传的文件。这两个版本都使用相同的数据存储。
请注意,数据存储本身是无模式的。每个实体都是键/值对的独立集合。两个相同类型的实体不必共享同一组属性或属性类型。 db.Model在数据存储区周围提供ORM抽象,但没有定义或实施任何类型的全局模式。
尽管datstore没有版本控制,但它支持命名空间。如果您希望每个主要版本的应用都有一个新的数据存储段,那么可以这样做:
import os
from google.appengine.api import namespace_manager
namespace_manager.set_namespace(os.environ ['CURRENT_VERSION_ID'])
Google App Engine has the concept of app versions. i.e., you can have multiple versions of your app running concurrently and accessible at different subdomains. For instance: http://1.my-app-name.appspot.com
, http://2.my-app-name.appspot.com
.
What aspects of the app are actually "versioned" by this? Is it only the Python + Static files codebase? Does the datastore have the concept of "versions"? If not, then what happens when I update the definition of a Google App Engine model?
Thanks!
Correct, app version refers only to your uploaded files. Both versions use with the same datastore.
Note that the datastore itself is schema-less. Each entity is an independent collection of key/value pairs. Two entities of the same kind don't have to share the same set of properties, or property types. db.Model provides an ORM abstraction around the datastore, but doesn't define or enforce any kind of global schema.
While the datstore isn't versioned, it does support namespacing. If you want a new datastore segment for each major version of your app, you can do this:
import os
from google.appengine.api import namespace_manager
namespace_manager.set_namespace(os.environ['CURRENT_VERSION_ID'])
这篇关于数据存储区中的Google App Engine版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!