In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "Hbase case study". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Case background: ladies and gentlemen, I believe you all have a history of browsing Phoenix New Media, so I believe you have all clicked on Phoenix New Media's advertisement, but have you found a phenomenon? When you click on an ad one day, similar ads will appear in the next few days, and now all the big websites will have this phenomenon. For example, if you click on the furniture ad today, you will find that the advertisements that pop up are all related to furniture.
User behavior analysis.
Maybe all of you are familiar with this term. And this is a typical case of user behavior analysis in reality.
User behavior analysis, analysis is the data, where the data comes from, from the database. The data in the database is generated from the user's behavior. In view of this process, it is natural to think: how to achieve it? How to implement if the data is saved in Hbase.
In view of this situation, if it is well designed to save to the traditional relational database, design three tables, a user table, an advertising table, a user operation record table, and the operation record table contains advertising foreign keys for the operation.
So if I save it in Hbase, because I have no previous experience in designing Hbase, I will design my first Hbase data structure based on my own knowledge of Hbase:
Topic analysis: user behavior analysis can be regarded as a requirement of user theme. It refers to a user topic, which can contain multiple requirements, such as user theme, user behavior analysis, user area analysis, user gender analysis, user age structure analysis, and so on. The following is mainly about how to implement user behavior analysis in Hbase.
Hbase database design:
Create two tables in Hbase:
A user table: USER, which contains two column families: one is the user attribute column family (family name: userProperty), and the other is the user behavior property (actionProperty). The key is: user ip
The other is the advertising table: ADVERT, which contains a column family (adProperty)
Let's talk about the two tables and what are the columns of the three column families:
USER:userProperty: user Ip area (ipArea), user ip International (ipCountry), user name ID (userId)
USER:actionProperty: click on the link (link); Advertising Line (adId); Click time (time)
ADERT:adProperty: advertising industry (adHy), advertising profit (adMoney), advertising merchant comp
Create these two tables
Insert a row key data into the adProperty of the advertisement table:
Put 'ADERT','ad00120311',' adProperty:adHy', 'Furniture'
Put 'ADERT','ad00120311',' adProperty: adMoney','11.11'
Put 'ADERT','ad00120311',' adProperty: comp',' Taobao
Let's analyze the user's process and create data:
1: when the user clicks on Phoenix New Media's advertisement for the first time, Phoenix New Media gets the user's Ip and user id (if logged in)
2: Phoenix New Media queries the operation record of the ip from the USER table from the actionProperty according to the user ip. If there is no operation record of the ip:
Then save the user's ip, and save the record of this operation, all saved in the USER table, but the saved column families belong to actionProperty and userProperty respectively.
Example data:
Save user properties
Put 'USER','11.11.11.1','userProperty:ipArea',' Shanghai'
Put 'USER','11.11.11.1','userProperty:ipCountry',' China'
Put 'USER','11.11.11.1','userProperty:userId','100001213'
Save user behavior
Put 'USER','11.11.11.1',' actionProperty: link,'/ifeng.com/.
Put 'USER','11.11.11.1',' actionProperty:adId','ad00120311'
Put 'USER','11.11.11.1',' actionProperty:time','20130623172900'
3: the next time a user uses the same IP to enter Phoenix New Media, Phoenix New Media will increase the user ip to look for data in the userProperty column family of the user table USER. If it can be found, use ip to find the user's operation record in the actionProperty of USER. If you can find it, you can get the id of the advertisement. This means that during this period of time, the user is interested in the product, so he needs to push this type of advertisement, and then use the advertisement id to find the advertisement in the advertising table ADVERT, and then find all the advertising information of the industry to push to the user.
This is the end of the Hbase case study. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.