广告投放的数据库设计
我正在构建一个类似于 Facebook 上的广告投放系统。基本上,我的客户可以根据我们不断从他们那里收集的位置和生物数据来创建广告并将其定位到特定的会员。
目前它是这样设计的..
member
-----
id
fname
lname
country_id
state_id
region_id
postcode_id
etc..
我知道我只需要邮政编码ID并在邮政编码表中查找它..但是我有大约50个邮政编码表,每个国家一个..对我来说更容易..
member_profile
-----
id
mem_id
bio_q (id linked to varchar .. eg. 'profession')
bio_a
advert
-------
id
client_id
ad_title
ad_line
start_date
end_date
status
etc..
advert_target
-----
id
advert_id
fk_id
type
例如数据上面..
1, 1, 1, 'state'
2, 1, 2, 'state'
3, 1, 5, 'profession'
我认为这样做的一种方法是做一大堆联合声明...不确定这是否是最有效的方法..任何方向上的帮助将不胜感激
谢谢
..
i am building an ad delivery system similar to the one on facebook.. Basically my clients can create adverts and target them to particular members, based on location and bio data that we will constantly collect from them.
at the moment it is designed as so..
member
-----
id
fname
lname
country_id
state_id
region_id
postcode_id
etc..
I know i only need the postcodeid and the look it up in the postcode table.. but i have around 50 postcode tables one for each country.. just easier for me..
member_profile
-----
id
mem_id
bio_q (id linked to varchar .. eg. 'profession')
bio_a
advert
-------
id
client_id
ad_title
ad_line
start_date
end_date
status
etc..
advert_target
-----
id
advert_id
fk_id
type
eg data for above..
1, 1, 1, 'state'
2, 1, 2, 'state'
3, 1, 5, 'profession'
one way i though of doing it is by doing a whole heap of union statements... not sure if this the most effecient way.. any help with direction would be greatly appreciated..
thanks
a
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,此类应用程序引入“细分”的概念,将用户分配到细分,并在细分中定位广告。
因此,您可以将给定用户分配给 5 个分段“住在欧洲”、“住在意大利”、“住在罗马”、“住在邮政编码 x 的 5 公里范围内”、“至少 18 岁”,
然后可能有针对“住在意大利”、“年满 18 岁”、“至少访问过该网站 3 次”等细分受众群的广告;我们的样本用户在 3 个标准中得分为 2,因此只有在没有更符合条件的人出现的情况下才会显示广告。
您想要在常规数据库作业中预先填充段;即使在中等流量的情况下,即时执行此操作也会使您的系统瘫痪。
Typically, this kind of application introduces the concept of "segment", assigns users to segments, and targets ads at segments.
So, you might assign a given user to 5 segments "lives in Europe", "lives in Italy", "lives in Rome", "lives within 5 kilometers of postcode x", "is at least 18 years old",
You then might have ads targeting segments "lives in Italy", "is at least 18 years old", "has visited the site at least 3 times"; our sample user score 2 out of 3 criteria, so might only be shown ads if noboy more qualified turns up.
You want to pre-populate your segments in regular database jobs; doing this on the fly will cripple your system with even moderate levels of traffic.