涉及广告网络分析的 MySQL 应用程序:表设计
现在,我正在记录展示次数、点击次数、点击率。 Impressions 是广告展示次数,Clicks 是广告点击次数,CTR 是点击率,计算公式为:点击次数/展示次数 目前我有三张桌子->
- in_table(in_imp, in_clks, in_ctr) 对于广告商
- out_table(out_imp, out_clks, out_ctr) 对于发布商
现在我想知道什么是重新组织这个表结构的更好方法。
Now, I am recording impressions, clicks, ctr.
impressions are the ad impressions, clicks are the ad clicks and ctr is the click through rate worked out by = clicks/impressions
Currently I have three tables->
- in_table(in_imp, in_clks, in_ctr) for advertisers
- out_table(out_imp, out_clks, out_ctr) for publishers
Now I was wondering what would be a better way to reorganise this table structure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
总的来说,我没有发现任何问题,但我建议您查看 openx 并了解它们如何收集和存储数据。我并不是说他们的方式是唯一的方式,但 openx 是一个非常流行的广告服务器,并且已经存在了一段时间了。
除此之外,openx 有大量功能,您可能最终会使用它。
一般来说,很难建议一种一刀切的表设置,因为恕我直言,这很大程度上取决于数据量(例如,多少、多快)以及您想要从数据创建的报告。 MySQL 似乎甚至不是完成这项工作的完美工具——但谁知道呢。
既然你计划使用 MySQL,我对你的其他建议是研究表引擎(例如 MyISAM 与 INNODB),然后考虑如何分解数据(例如每周或每月一个表?)并提前考虑汇总数据以用于稍后的报告等。
In general I see nothing wrong but I'd suggest you take a look at openx and see how they collect and store data. I'm not saying that their way is the only way, but openx is a very popular adserver and has been around the block a while.
Add to that, that openx has a ton of features and you might just end up using it.
Generally it's hard to suggest a one-size-fits-all table setup because IMHO this very much depends on data volume (e.g. how many, how fast) and also on the reports you want to create from data. MySQL may not even seem to be the perfect tool for the job - but who knows.
Since you plan on using MySQL my other suggestions for you are to investigate table engines (e.g. MyISAM vs. INNODB), then to think about how to break up data (e.g. a table per week, or month?) and also to think ahead about aggregating the data for reports and so forth later on.