Google App Engine Versioning in the Datastore

前端 未结 2 1620
时光说笑
时光说笑 2021-02-01 22:53

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:

2条回答
  •  情深已故
    2021-02-01 23:24

    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'])
    

提交回复
热议问题