![Page 1: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/1.jpg)
THE LITTLE ENGINE(S) THAT COULD:SCALING ONLINE SOCIAL NETWORKS
B99106017 圖資三 謝宗昊
![Page 2: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/2.jpg)
Outline
• Background• SPAR• Evaluation and Comparison• Conclusion
![Page 3: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/3.jpg)
Outline
• Background• SPAR• Evaluation and Comparison• Conclusion
![Page 4: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/4.jpg)
New challenge for system design• Online Social Networks(OSNs) are hugely interconnected• OSNs grow rapidly in a short period of time
• Twitter grew by 1382% between Feb And Mar 2009• Cause costly re-architecting for service
• Conventional vertical scaling is not a good solution• Horizontal scaling leads to interconnecting issue• Performance bottleneck
![Page 5: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/5.jpg)
Full Replication
![Page 6: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/6.jpg)
Random Partition (DHT)
![Page 7: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/7.jpg)
Random Partition (DHT) with replication of the neighbors
![Page 8: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/8.jpg)
SPAR
![Page 9: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/9.jpg)
Designer’s Dilemma• Commit resources to develop the feature
+ Appealing feature to attract new user
- “Death by success”
• Ensure the scalability first+ Low risk on “Death by success”
- Hard to compete with other creative competitors
![Page 10: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/10.jpg)
Outline
• BackGround• SPAR• Evaluation and Comparison• Conclusion
![Page 11: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/11.jpg)
SPAR• A Social Partitioning And Replication middle-ware for
social applications.
![Page 12: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/12.jpg)
What does SPAR do and not do?
DO• Solves the Designer’s Dilemma for early stage OSNs• Avoids performance bottlenecks in established OSNs.• Minimizes the effect of provider lock-ins
NOT DO• Not designed for the distribution of content such as
pictures and videos• Not the solution for storage or for batch data analysis
such as Hadoop
![Page 13: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/13.jpg)
How does SPAR do it?• Provides local semantics• Handles node and edge dynamics with minimal overhead• Serves more requests while reducing network traffic
![Page 14: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/14.jpg)
Problem Statement• Maintain local semantics• Balance loads• Be resilient to machine failures• Be amenable to online operation• Be stable• Minimize replication overhead
![Page 15: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/15.jpg)
Why not graph/social partitioning?• Not incremental• Community detection is too sensitive• Reduce inter-partition edges ≠ Reduction of replicas
![Page 16: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/16.jpg)
Description• Node addition/removal• Edge addition/removal• Server addition/removal
![Page 17: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/17.jpg)
Node addition/removal
Node Addition• New node to the partition with fewest master replicas
Node Removal• The master and all slaves should be removed• The node have and edge with it should be updated
![Page 18: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/18.jpg)
Edge addition/removal
Edge Addition: Three possible configurations• No movement of master• Master of u goes to the partition containing master of v• Master of v goes to the partition containing master of u
Edge Removal• Remove the replica of u in the partition holding the master
of node v if no other requires it
![Page 19: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/19.jpg)
Edge addition
![Page 20: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/20.jpg)
Server addition/removal
Server Addition: Two solution• Force redistribution for load balance immediately• Redistributing the master by node/edge processes
Server Removal• The highly connected nodes choose the server first
![Page 21: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/21.jpg)
Implementation• SPAR is a middle-ware(MW) between datacenter and
application• SPAR includes 4 components:
• Directory service (DS)• Local Directory Service (LDS)• Partition Manager (PM)• Replication Manager (RM)
![Page 22: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/22.jpg)
Implementation
![Page 23: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/23.jpg)
Outline
• Background• SPAR• Evaluation and Comparison• Conclusion
![Page 24: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/24.jpg)
Evaluation methodology
Metrics• Replication overhead• K-redundancy requirement
Dataset• Twitter: 12M tweet generated by 2.4M users• Facebook: 60,290 nodes and 1,545,686 edges• Orkut: 3M nodes and 223M edges
![Page 25: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/25.jpg)
Evaluation methodology
Algorithm for comparison• Random Partitioning
• Solutions used by Facebook, Twitter
• Graph Partitioning (METIS)• Minimize inter-partition edges
• Modularity Optimization (MO+) algorithm• Community detection
![Page 26: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/26.jpg)
Evaluation of replication overhead
![Page 27: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/27.jpg)
SPAR Versus Random for K=2
![Page 28: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/28.jpg)
Dynamic operations and SPAR
![Page 29: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/29.jpg)
Dynamic operations and SPAR
![Page 30: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/30.jpg)
Adding/Removing Server• Adding server has two policies:
1. Wait for new arrivals to fiull up the server
2. Re-distribute existing master from other server into the new server
Wait for new arrival
Re-distribute
Started with 32 servers
overhead 2.78 2.82 2.74
![Page 31: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/31.jpg)
Adding/Removing Server• Removing Server
• Average number of movements: 485k• Overhead increases from 2.74 to 2.87• Reduce overhead to 2.77 if additional 180k transmissions• Painful but not common to scale down
![Page 32: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/32.jpg)
SPAR IN THE WILD• Testbed: 16 low-end commodity servers
• Pentium Duo CPU 2.33GHz• 2GB of RAM• Single hard drive
• Evaluation with Cassandra• Evaluation with MySQL
![Page 33: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/33.jpg)
Evaluation with Cassandra
![Page 34: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/34.jpg)
Evaluation with MySQL
Full Replication SPAR
99th percentiles of the response time without insertion of updates
152ms for 16 req/s 150ms for 2,500 req/s
Full Replication SPAR
95th percentiles of the response time with insertion of updates
N/A(Too poor) 260ms for 50 read req/s380ms for 200 read req/s
![Page 35: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/35.jpg)
Outline
• Background• SPAR• Evaluation and Comparison• Conclusion
![Page 36: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/36.jpg)
Conclusion• Preserving local semantics has many benefit
• SPAR can achieve it in low replication overhead
• SPAR can deal with the dynamics experienced by an OSN gracefully
• Evaluation with RDBMS(MySQL) and a Key-Value Store(Cassandra) shows that SPAR offer significant gains in throughput(req/s) while reducing network traffic
• To sum up, SPAR would be a good solution for Scaling OSNs.
![Page 37: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/37.jpg)
Reference• http://www.cl.cam.ac.uk/~
ey204/teaching/ACS/R202_2011_2012/presentation/S6/Arman_SPAR.pdf - Arman Idani
![Page 38: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/38.jpg)
Q&A time
![Page 39: THE LITTLE ENGINE(S) THAT COULD: SCALING ONLINE SOCIAL NETWORKS B99106017 圖資三 謝宗昊](https://reader033.vdocuments.pub/reader033/viewer/2022061609/56649eff5503460f94c1471a/html5/thumbnails/39.jpg)
Thanks for Listening