简体   繁体   English

在AppEngine中记录操作的最佳做​​法

[英]Best Practice to log actions in AppEngine

We are making a small download site for software we create on AppEngine. 我们正在为我们在AppEngine上创建的软件制作一个小型下载站点。 We now would like to track the downloads of each product and are wondering, if there is a preferred way of doing so. 现在,我们想跟踪每个产品的下载,并且想知道是否有这样做的首选方法。

Basically, we have two approaches: 基本上,我们有两种方法:

  1. Having a counter Entity for each file (filename, year and month as key) which is increased upon a download. 每个文件都有一个计数器实体(文件名,年和月为键),下载后会增加。
  2. Logging each action to the database and then have a scheduled task collecting them 将每个操作记录到数据库中,然后安排任务来收集它们

Does someone here have experience with either way? 这里有人有这两种方式的经验吗? Would it be possible to have concurrent requests on the counter Entity (and giving the correct result)? 是否可以在计数器实体上有并发请求(并给出正确的结果)? Or would a third way be better? 还是第三种方法会更好?

many thanks in advance for all ideas. 在此先感谢所有想法。

If you only need to count the downloads use a counter, don't bother with an audit trail per download. 如果您只需要使用计数器来计算下载次数,则不必担心每次下载的审核记录。
Follow the guidelines in sharding counters on how to do it effectively on the App engine 遵循分片计数器中的指南,了解如何在App引擎上有效地做到这一点

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

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