在 Google App Engine 中使用 Java 存储和访问大型静态数据的最佳方式是什么?
我的大部分应用程序“动态”数据都存储在数据存储中。
但是,我还有大量静态数据,这些数据只会随着应用程序的新版本而改变。一系列平面文件似乎可能比在数据存储中管理它更简单。
有没有标准的解决方案?如何使用库来快速轻松地加载/解析此内容?将这些数据推送到数据存储是否更有意义?哪个会表现更好?
还有其他人遇到这个问题并且有战争故事可以分享吗?
I have my most of my apps "dynamic" data stored in the datastore.
However, I also have a large collection of static data that would only change with new builds of the app. A series of flat files seems like it might be simpler than managing it in the datastore.
Are there standard solutions to this? How about libraries to make loading/parsing this content quick and easy? Does it make more sense to push this data to the datastore? Which would perform better?
Anyone else have this problem and have war stories they can share?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一切都取决于您需要如何使用这些信息。
例如,我有一个应用程序需要从静态数据提供启动状态。由于我希望在应用程序之外轻松准备这些静态数据,因此我将数据作为电子表格放在 Google Docs 上,然后我的 Web 应用程序中有一个管理功能,可以通过 Google Docs Spreadsheet API 将起始状态加载到数据存储中的对象。它工作得相当好,尽管有一些我还没有完全解决的可靠性问题(我有时需要重新启动该过程)。
在其他情况下,您可能只需将数据包含为静态属性/xml 文件并通过标准 Java 资源 API(getResourceAsStream 等)加载它们即可。但我还没有尝试过这种方法,因为它在我的特定情况下没有意义。
Everything depends on how you need to use the information.
I for instance have an application that needs to have a starting state provided from static data. Since I wanted this static data to be easily prepared outside the application, I put the data as spreadsheets on Google Docs and then I have an administrative function in my web app to load the starting state through Google Docs Spreadsheet API to objects in the datastore. It works fairly well, although there are some reliability issues that I haven't quite worked out yet (I sometimes need to restart the process).
In other cases, you might get away with just including the data as static property/xml files and load them through the standard Java resource APIs (getResourceAsStream and such). I haven't tried this approach though since it wasn't meaningful in my particular situation.