[五个月后]
我们的游戏框架就完成了。
最后,我们决定将静态数据存储在每个 Web 服务器中完全初始化的 sqlalchemy 模型实例中。当新启动的游戏服务器正在预热时,这些实例首先通过访问共享的 MySQL 数据库来构建。
Since our Model factories defer to an instance pool, the Model instances need only be constructed once per deployment per server – this is important, because at our scale, MySQL would weep under any sort of ongoing load. We accomplished our goal of not streaming this data over the wire by keeping the item definitions as close to our app code as possible: in the app code itself.
I now realize that my original question was naive, because unlike in the LAMP stack, the Flask server keeps running between requests, the server's memory itself is "shared memory" – there's no need for something like APC to make it so. In fact, anything outside of the request processing scope it self and Flask's threadsafe local store, can be considered "shared memory".