在AppEngine中记录操作的最佳实践

时间:2022-06-23 22:00:07

We are making a small download site for software we create on AppEngine. We now would like to track the downloads of each product and are wondering, if there is a preferred way of doing so.

我们正在为我们在AppEngine上创建的软件创建一个小型下载站点。我们现在想跟踪每个产品的下载,并且想知道是否有这样做的首选方式。

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. 具有每个文件的计数器实体(文件名,年份和月份作为密钥),在下载时增加。

  3. Logging each action to the database and then have a scheduled task collecting them
  4. 将每个操作记录到数据库,然后让计划任务收集它们

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.

非常感谢所有的想法。

1 个解决方案

#1


0  

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引擎上有效地执行此操作

#1


0  

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引擎上有效地执行此操作