12. 효과는?
• 아마존 매출의 30%는 추천을 통해 발생
by The Economist “Building with big data”
http://www.economist.com/node/18741392/
• 약 75%의 사용자들이 추천 서비스를 통해
영화를 선택
by Nextflix “Netflix Recommendations”
http://techblog.netflix.com/2012/04/netflixrecommendations-beyond-5-stars.html
53. 데이터수집
데이터변환
추천계산
추천결과제공
• 추천 결과는 Json으로 저장
– 결과에 대한 Hash 생성 (RecoHash)
1
[{"id":“10", "score":0.29,"method":"4"},
{"id":“11,"score":0.15,"method":"4"},{"id":“13","score":0.14,
"method":"4"},{"id":“17","score":0.14,"method":"4"}]
– MD5(“10/11/13/17”) = 7ff3949e2d0e0d1a
– 어차피 추천 리스트가 자주 변하지는 않는다.
– DB에 불필요한 update를 줄이자.
– 실제로 평균 10~20% 정도만 리스트가 변경됨
61. AWS – 자체 클러스터를 운영하는 경우
10.1.2.10
54.25.1.12
무료
유료
10.1.2.11
54.23.233.16
62. CDH
• Hadoop만 설치할 거라면 apache 버전도
할만함
• HBase, oozie 등을 함께 쓴다면?
– CDH가 100만 배 정도 편함
– 덤으로 모니터링도
– 대수 제한도 없어졌음
• CDH manager 4.6에 버그 있음
– 장비 추가 안됨 (API 사용 or 4.7 버전 업)
63. HDFS로 Data를 저장하는 경우
• 디렉토리로 파일 관리하기 귀찮음
– map task 파편화(?)를 막기 위한 file merge
– 오래된 파일 삭제
– 로그 포맷이 변경되면?
– 1주일/1달/5달 데이터를 쓰고 싶어요 -_-;
64. HBase
• HBase를 쓰면
– file merge 따위 ㅋ
– TTL을 이용해서 자동 삭제
– 컬럼 추가 및 삭제가 쉬움. NoSQL ㅋ
– 설정으로 time filtering을 한 번에
65. HBase – parsed_log table 구성
row key
service_id
item_id
column family
timestamp
uid
action_id
price
referrer
category
69. Scan s = new Scan()
s.setFilter(new RowFilter(start, stop));
sid=1
7월
map
map
8월
map
map
9월
7월
sid=2
8월
9월
map
map
map
map
sid=1, 8월~9월
70. Scan s = new Scan()
s.setFilter(new RowFilter(start, stop));
sid=1
Scan s =
new Scan(start, stop);
sid=1, 8월~9월
7월
8월
map
map
9월
7월
sid=2
8월
9월
map
71. Scan s =
new Scan(start, stop);
Scan s = new Scan()
s.setFilter(new RowFilter(start, stop));
sid=1
sid=1, 8월~9월
sid=2, 9월
7월
8월
map
map
9월
7월
sid=2
8월
9월
map
map
map
map
72. new Scan(start, stop) multi-scan
sid=1
sid=1, 8월~9월
sid=2, 9월
7월
8월
map
map
9월
map
7월
sid=2
8월
9월
map
https://github.com/
christianrichter/
hbase_multisegment
75. 모니터링 및 알람
• 장비 모니터링 및 alarm 시스템이 없었음
• 처음부터 만들려면 어려움
– open source customizing도 귀찮다
• aws 에서 제공되는 tool 을 사용하자
– Cloudwatch
– SES (Simple Email Service)
– SNS (Simple Notification Service)