1.[d2 오픈세미나]on thearchitectureofsocialnetworkservice
DESCRIPTION
TRANSCRIPT
Haebin Na [email protected] LINE DevCenter1
2014.08.25. Public ����������� ������������������
ⓒ 2013����������� ������������������ LINE����������� ������������������ CORPORATION
On the Architecture of Social Network Service
Contents����������� ������������������
1. What Is Social? 2. Why Is It Challenging? 3. How Are Giants Doing? 4. How is LINE Doing? 5. What Can You Do?
1. What Is Social?
4����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
싸이월드는 세계 최초의 소셜 네트워크 서비스인가?
기능적����������� ������������������ 관점에서는����������� ������������������ 소셜����������� ������������������ 네트워크����������� ������������������ 서비스라고����������� ������������������ 보기����������� ������������������ 어려울����������� ������������������ 수����������� ������������������ 있음.����������� ������������������ 친구들의����������� ������������������ 변경된����������� ������������������ 상태를����������� ������������������ 모아����������� ������������������ 보여주는����������� ������������������ 기능이����������� ������������������ 주����������� ������������������ 기능이����������� ������������������ 아니었음.����������� ������������������
5����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
2006년����������� ������������������ 2월����������� ������������������ 26일����������� ������������������ –����������� ������������������ 트위터����������� ������������������ 홈타임라인����������� ������������������ 기능����������� ������������������ 시작����������� ������������������ 2006년����������� ������������������ 9월����������� ������������������ 5일����������� ������������������ –����������� ������������������ 페이스북����������� ������������������ 뉴스����������� ������������������ 피드����������� ������������������ 기능����������� ������������������ 시작����������� ������������������
6����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
2007년����������� ������������������ 2월����������� ������������������ –����������� ������������������ 미투데이����������� ������������������ 서비스����������� ������������������ 개시����������� ������������������ 2007년����������� ������������������ 3월����������� ������������������ –����������� ������������������ 플레이토크����������� ������������������ 서비스����������� ������������������ 개시����������� ������������������
7����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
소셜 네트워크 서비스는 ㅁㅁㅁㅁ가 있다. 모아보기,����������� ������������������ 타임라인,����������� ������������������ 뉴스피드����������� ������������������ 등.����������� ������������������
2. Why Is It Challenging?
9����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ http://www.businessinsider.com/incredible-things-that-happen-every-60-seconds-on-the-internet-2011-12����������� ������������������
10����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
빅 데이터와 그냥 데이터의 차이가 뭔가요?
3V:����������� ������������������ Volume,����������� ������������������ Velocity,����������� ������������������ Variety����������� ������������������
3. How Are Giants Doing?
12����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
인덱스 & 스토리지
SNS����������� ������������������ 아키텍처를����������� ������������������ 살필때,����������� ������������������ 크게����������� ������������������ 피드����������� ������������������ 인덱스와����������� ������������������ 스토리지로����������� ������������������ 분리해서����������� ������������������ 볼����������� ������������������ 것.����������� ������������������
13����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
Service: News Feed
Leafs
Aggregators
News Feed Service: Writes
▪ On User update (Write)
▪ Index sharded by Writer
▪ Need to update one leaf
Query [ Read ]
User Update [ Write ]
Service: News Feed
Leafs
Aggregators
News Feed Service: Reads
▪ On Query (Read)
▪ Query all leafs
▪ Then do aggregation/ranking
Query [ Read ]
User Update [ Write ]
[1]����������� ������������������ http://www.ece.lsu.edu/hpca-18/files/HPCA2012_Facebook_Keynote.pdf����������� ������������������ ����������� ������������������
Index����������� ������������������
Pull����������� ������������������ 방식,����������� ������������������ 뉴스피드����������� ������������������ 조회시����������� ������������������ 친구들의����������� ������������������ 글을����������� ������������������ 조회����������� ������������������
14����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ https://www.facebook.com/notes/facebook-engineering/tao-the-power-of-the-graph/10151525983993920����������� ������������������
Data����������� ������������������
Graph����������� ������������������ Data����������� ������������������ Model����������� ������������������
15����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ https://www.facebook.com/notes/facebook-engineering/tao-the-power-of-the-graph/10151525983993920����������� ������������������ ����������� ������������������
Storage - TAO����������� ������������������
Graph����������� ������������������ Data����������� ������������������ 저장소����������� ������������������
16����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ http://highscalability.com/blog/2013/7/8/the-architecture-twitter-uses-to-deal-with-150m-active-users.html����������� ������������������ ����������� ������������������
Index����������� ������������������
Push����������� ������������������ 방식,����������� ������������������ 트윗����������� ������������������ 작성시����������� ������������������ 친구들의����������� ������������������ 타임라인에����������� ������������������ 전달����������� ������������������
17����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ http://gigaom.com/2010/04/07/gizzard-anyone-twitter-offers-up-code-for-distributed-data/����������� ������������������
Storage – Gizzard + FlockDB����������� ������������������
트윗����������� ������������������ 저장소,����������� ������������������ Retired����������� ������������������
18����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ https://blog.twitter.com/2014/manhattan-our-real-time-multi-tenant-distributed-database-for-twitter-scale����������� ������������������ ����������� ������������������
New Storage – Manhattan����������� ������������������
새로운����������� ������������������ 트윗����������� ������������������ 저장소����������� ������������������
19����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
Solution
전체����������� ������������������ 시스템에서����������� ������������������ 가장����������� ������������������ 효율적인����������� ������������������ 방식은����������� ������������������ ����������� ������������������ 사용자의����������� ������������������ 읽기/쓰기����������� ������������������ 패턴에����������� ������������������ 따른����������� ������������������ Pull����������� ������������������ &����������� ������������������ Push의����������� ������������������ Hybrid����������� ������������������ 방식����������� ������������������
4. How Is LINE Doing?
21����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
����������� ������������������ ����������� ������������������
[1]����������� ������������������ http://helloworld.naver.com/helloworld/809802����������� ������������������ ����������� ������������������ ����������� ������������������
Horizontal & Vertical Access Pattern����������� ������������������
����������� ������������������ LINE����������� ������������������ 타임라인과����������� ������������������ 홈의����������� ������������������ Data����������� ������������������ Access����������� ������������������ Pattern����������� ������������������
22����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
����������� ������������������ ����������� ������������������
[1]����������� ������������������ http://helloworld.naver.com/helloworld/809802����������� ������������������ ����������� ������������������ ����������� ������������������
Index����������� ������������������
����������� ������������������ Push����������� ������������������ 방식으로����������� ������������������ 개인����������� ������������������ 및����������� ������������������ 대규모����������� ������������������ 전송����������� ������������������ 처리����������� ������������������
23����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
����������� ������������������ ����������� ������������������
[1]����������� ������������������ http://helloworld.naver.com/helloworld/809802����������� ������������������ ����������� ������������������ ����������� ������������������
Index + Storage Overview����������� ������������������
����������� ������������������ LINE����������� ������������������ 홈/타임라인의����������� ������������������ 전체����������� ������������������ 스토리지����������� ������������������ 아키텍처����������� ������������������
5. What Can You Do?
25����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
”Show me your code and conceal your data structures, and I shall continue to be mystified. Show me your data structures, and I won't usually need your code; it'll be obvious.”
- Eric S. Raymond, ‘The Cathedral and Bazaar’
����������� ������������������ 데이터����������� ������������������ 구조가����������� ������������������ 코드보다����������� ������������������ 중요.����������� ������������������ 데이터����������� ������������������ 구조에����������� ������������������ 맞는����������� ������������������ 저장소를����������� ������������������ 쓰는����������� ������������������ 것이����������� ������������������ 중요.����������� ������������������
26����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
어떻게 모델링하고 어디에 저장할 것인가
27����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
[1]����������� ������������������ http://eincs.com/2013/07/misleading-and-truth-of-cap-theorem/����������� ������������������ ����������� ������������������ ����������� ������������������ ����������� ������������������
����������� ������������������ 크게����������� ������������������ Consistency����������� ������������������ vs.����������� ������������������ Availability����������� ������������������ 관점에서����������� ������������������ 적합한����������� ������������������ 저장소를����������� ������������������ 선택����������� ������������������
Summary
29����������� ������������������ On����������� ������������������ The����������� ������������������ Architecture����������� ������������������ of����������� ������������������ Social����������� ������������������ Network����������� ������������������ Service����������� ������������������
����������� ������������������
����������� ������������������ 상충����������� ������������������ Tradeoffs:����������� ������������������ Pull����������� ������������������ vs.����������� ������������������ Push,����������� ������������������ Consistency����������� ������������������ vs.����������� ������������������ Availability����������� ������������������ ����������� ������������������
Thank you.����������� ������������������
Questions & Answers.����������� ������������������