横幅印象跟踪 - 数据库设计 [英] Banner Impressions Tracking - Database Design

查看:99
本文介绍了横幅印象跟踪 - 数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



IE我有5个横幅在x域上



我想在每个横幅上建立每个横幅广告每天的展示次数等数据。所以也可以查找其他日期范围。



最好每行每天都有一个日期,或是每行追踪每个展示次数。



希望你能建议。



感谢Advance

解决方案

我建议您创建最灵活的设计,让您根据需求在未来建立新的报告。您建议客户要求有关每天印象的报告。如果他们晚些时候来,说一天中的什么时间是最显着的印象呢?那么最为灵活的做法就是让每个印象有1条记录,每条记录只有$ b,那么他们什么时候点击大部分呢?



$ b banner_id
timestamp



稍后,您可以创建一个聚合历史数据的存储过程,从而清除您积累的大量数据,创建关于你所关心的粒度级别的报告。我可以想象一个月的小时数据和一年的每日数据。存储过程只会写入归档表:




  • 横幅ID

  • 时间间隔标识符每月数据的月份/年份,或每日数据的日/月/年等)

  • 展示次数


Looking for some good advice on db design for tracking multiple banner impressions.

IE I have 5 Banners over x Domains

I would like to build data on each banner on how many impressions per day per banner etc. So also be able to do lookups for other date ranges.

Would it be best to have a date per day per row or just track each impression per row.

Hope you can advise.

And thanks in Advance

解决方案

I'd recommend to create the most flexible design that would allow you to create new reports as requirements extend in the future. You suggest that the customer wants reports on "impressions per day". What if they come in later and say "what time of the day are impressions shown most at"? How about "when are they clicked on most"?

So the most flexible way to do this is to have 1 record for each impression, where each record is just banner_id timestamp

Later on, you can create a stored procedure that aggregates historical data and thus purges HUGE amounts of data that you have accumulated - thus, creating reports on the level of granularity that you care about. I can imagine storing hourly data for a month, and daily data for a year. The stored procs would just write to an archive table:

  • Banner ID
  • Time interval identifier (of the month/year for monthly data, or day/month/year for daily data, etc)
  • Number of impressions

这篇关于横幅印象跟踪 - 数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆