optimizing inter-server communication for online social

10
Optimizing Inter-Server Communication for Online Social Networks Jing TANG Interdisciplinary Graduate School Nanyang Technological University Email: [email protected] Xueyan TANG School of Computer Engineering Nanyang Technological University Email: [email protected] Junsong YUAN School of EEE Nanyang Technological University Email: [email protected] Abstract—Distributed storage systems are the key infrastruc- tures for hosting the user data of large-scale Online Social Networks (OSNs). The amount of inter-server communication is an important scalability indicator for these systems. Data partitioning and replication are two inter-related issues affecting the inter-server traffic caused by user-initiated read and write operations. This paper investigates the problem of minimizing the total inter-server traffic among a cluster of OSN servers through joint partitioning and replication optimization. We propose a Traffic-Optimized Partitioning and Replication (TOPR) method based on an analysis of how replica allocation affects the inter- server communication. Lightweight algorithms are developed to adjust partitioning and replication dynamically according to data read and write rates. Evaluations with real Facebook and Twitter social graphs show that TOPR significantly reduces the inter- server communication compared with state-of-the-art methods. I. I NTRODUCTION Online social networks (OSNs) are popular websites through which huge amounts of people communicate and share information. The most famous OSNs today include Facebook, QQ, Weibo, Google+, Twitter, Renren, LinkedIn, and Flickr. According to Nielsen’s latest report [1], people spent 20% of their PC time and 30% of their mobile time on OSNs. No other category of websites is comparable with OSNs in terms of time consumption. The data maintained by OSNs increase rapidly with their user base. To cope with explosive data growth, a natural solution is to partition the data among a group of servers [2]. Apache Cassandra [3], which combines Amazon Dynamo’s consistent hashing scheme [4] and Google BigTable’s data model [5], is a distributed data storage system most widely used to support large-scale OSNs such as Facebook and Twitter. However, Cassandra is far from efficient for OSNs due to their highly correlated data access patterns. An OSN user normally accesses not only her own data but also the data of other closely connected users. In Facebook, for instance, a user often views the status, figures, and videos updated by her friends. This property is known as social locality. Cassandra performs random data partitioning and replication that are blind to social locality. As a result, it leads to high inter-server traffic caused by user operations in OSNs [6], [7], [8], [9], [10]. Inter-server communication is an important scalability in- dicator for distributed data storage. Data partitioning and replication are two inter-related issues affecting the amount of inter-server communication. An intuitive approach to preserve social locality in OSN storage is to replicate each user’s data on the servers hosting her connected friends. Several methods such as SPAR [6] and S-CLONE [8] have been proposed to maximize the social locality of replication. While creating a replica can reduce the inter-server traffic for reading data, it also introduces new inter-server traffic for synchronization when the data is updated. Since OSN data are constantly created and edited by users, the write-incurred traffic cannot be neglected compared to the read-incurred traffic, particularly when a high degree of replication is needed. Aggressively striving for maximum social locality in replication does not necessarily optimize the total inter-server traffic. A recent SD 3 mechanism [9] proposes to create replicas only when they save more read-incurred traffic than the write-incurred traffic produced. Nevertheless, it assumes fixed data partitions. To the best of our knowledge, little work has studied minimizing the total read-incurred and write-incurred traffic among a cluster of OSN servers through joint partitioning and replication optimization. In this paper, we propose a Traffic-Optimized Partitioning and Replication (TOPR) method that performs social-aware partitioning and adaptive replication of OSN data in an inte- grated manner. Based on an analysis of how replica allocation affects the inter-server communication, we develop algorithms to adjust the replicas dynamically according to data read and write rates. Evaluations with the Facebook and Twitter social graphs demonstrate that TOPR can save the inter-server traffic significantly compared with various state-of-the-art methods. The rest of this paper is organized as follows. Section II reviews the related work. Section III constructs a model of the inter-server traffic and formally defines the optimization problem. Section IV elaborates the design of our TOPR method. Section V presents the experimental setup and results. Finally, Section VI concludes the paper. II. RELATED WORK Pujol et al. [6] proposed a middleware called SPAR to scale OSNs with a cluster of servers. SPAR aims to mini- mize the number of replicas required for connected users to always have their data co-located on the same servers while maintaining load balance across servers. The perfect social

Upload: others

Post on 16-Nov-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Optimizing Inter-Server Communication for Online Social

Optimizing Inter-Server Communicationfor Online Social Networks

Jing TANGInterdisciplinary Graduate SchoolNanyang Technological University

Email: [email protected]

Xueyan TANGSchool of Computer Engineering

Nanyang Technological UniversityEmail: [email protected]

Junsong YUANSchool of EEE

Nanyang Technological UniversityEmail: [email protected]

Abstract—Distributed storage systems are the key infrastruc-tures for hosting the user data of large-scale Online SocialNetworks (OSNs). The amount of inter-server communicationis an important scalability indicator for these systems. Datapartitioning and replication are two inter-related issues affectingthe inter-server traffic caused by user-initiated read and writeoperations. This paper investigates the problem of minimizing thetotal inter-server traffic among a cluster of OSN servers throughjoint partitioning and replication optimization. We propose aTraffic-Optimized Partitioning and Replication (TOPR) methodbased on an analysis of how replica allocation affects the inter-server communication. Lightweight algorithms are developed toadjust partitioning and replication dynamically according to dataread and write rates. Evaluations with real Facebook and Twittersocial graphs show that TOPR significantly reduces the inter-server communication compared with state-of-the-art methods.

I. INTRODUCTION

Online social networks (OSNs) are popular websitesthrough which huge amounts of people communicate and shareinformation. The most famous OSNs today include Facebook,QQ, Weibo, Google+, Twitter, Renren, LinkedIn, and Flickr.According to Nielsen’s latest report [1], people spent 20% oftheir PC time and 30% of their mobile time on OSNs. Noother category of websites is comparable with OSNs in termsof time consumption.

The data maintained by OSNs increase rapidly with theiruser base. To cope with explosive data growth, a naturalsolution is to partition the data among a group of servers [2].Apache Cassandra [3], which combines Amazon Dynamo’sconsistent hashing scheme [4] and Google BigTable’s datamodel [5], is a distributed data storage system most widelyused to support large-scale OSNs such as Facebook andTwitter. However, Cassandra is far from efficient for OSNsdue to their highly correlated data access patterns. An OSNuser normally accesses not only her own data but also the dataof other closely connected users. In Facebook, for instance, auser often views the status, figures, and videos updated by herfriends. This property is known as social locality. Cassandraperforms random data partitioning and replication that areblind to social locality. As a result, it leads to high inter-servertraffic caused by user operations in OSNs [6], [7], [8], [9],[10].

Inter-server communication is an important scalability in-dicator for distributed data storage. Data partitioning and

replication are two inter-related issues affecting the amount ofinter-server communication. An intuitive approach to preservesocial locality in OSN storage is to replicate each user’s dataon the servers hosting her connected friends. Several methodssuch as SPAR [6] and S-CLONE [8] have been proposed tomaximize the social locality of replication. While creating areplica can reduce the inter-server traffic for reading data,it also introduces new inter-server traffic for synchronizationwhen the data is updated. Since OSN data are constantlycreated and edited by users, the write-incurred traffic cannotbe neglected compared to the read-incurred traffic, particularlywhen a high degree of replication is needed. Aggressivelystriving for maximum social locality in replication does notnecessarily optimize the total inter-server traffic. A recent SD3

mechanism [9] proposes to create replicas only when theysave more read-incurred traffic than the write-incurred trafficproduced. Nevertheless, it assumes fixed data partitions. To thebest of our knowledge, little work has studied minimizing thetotal read-incurred and write-incurred traffic among a clusterof OSN servers through joint partitioning and replicationoptimization.

In this paper, we propose a Traffic-Optimized Partitioningand Replication (TOPR) method that performs social-awarepartitioning and adaptive replication of OSN data in an inte-grated manner. Based on an analysis of how replica allocationaffects the inter-server communication, we develop algorithmsto adjust the replicas dynamically according to data read andwrite rates. Evaluations with the Facebook and Twitter socialgraphs demonstrate that TOPR can save the inter-server trafficsignificantly compared with various state-of-the-art methods.

The rest of this paper is organized as follows. Section IIreviews the related work. Section III constructs a model ofthe inter-server traffic and formally defines the optimizationproblem. Section IV elaborates the design of our TOPRmethod. Section V presents the experimental setup and results.Finally, Section VI concludes the paper.

II. RELATED WORK

Pujol et al. [6] proposed a middleware called SPAR toscale OSNs with a cluster of servers. SPAR aims to mini-mize the number of replicas required for connected users toalways have their data co-located on the same servers whilemaintaining load balance across servers. The perfect social

Page 2: Optimizing Inter-Server Communication for Online Social

locality of SPAR’s replication eliminates the need for serversto acquire data from one another upon read requests. Similarly,S-CLONE method developed by Tran et al. [8] seeks tomaximize the social locality given a fixed number of replicasto set up. However, replicating data at the servers that rarelyread it could introduce more write-incurred traffic than theread-incurred traffic saved. Thus, SPAR and S-CLONE arenot able to minimize the total inter-server traffic.

Jiao et al. [7], [10] studied OSN data placement acrossmultiple geo-distributed clouds (datacenters) for optimizinga range of different objectives. Our work differs from thesestudies in that we consider data partitioning and replicationamong a cluster of servers within one cloud (datacenter). Inthe case of multiple clouds, due to elastic cloud resources,there is practically no limit on the amount of user data thatcan be hosted by a cloud. However, in the case of a servercluster, each server has a physical capacity limit. To guaranteethe service performance, the servers should be prevented frombecoming overloaded. Furthermore, the above studies eitherconduct replication for perfect social locality [7] or createa fixed number of replicas for each user [10]. As discussedabove, neither strategy is able to minimize the inter-servertraffic. Our proposed TOPR method complements the multi-cloud techniques and they can be combined to maximize theefficiency of OSN services.

SD3 is a selective data replication mechanism proposedby Liu et al. [9] for distributed datacenters. The mechanismavoids replicating the data with low read rates and highwrite rates to reduce the inter-datacenter traffic. However, SD3

assumes static data partitioning across datacenters and doesnot optimize it to further save the traffic. SD3 also considersdifferent data types separately for replication, such as wallposts and photo comments, due to their different read andwrite rates. Our proposed method is orthogonal to the datagranularity for replication. Separate consideration of differentdata types can be applied together with our method.

Also relevant to our problem are graph partitioning algo-rithms [11], [12] and community detection algorithms [13],[14]. The former targets at minimizing the inter-partition edgesand the latter aims to find the communities in OSNs. However,these algorithms are offline and cannot cope with the dynamicsin OSNs. They are not able to produce stable partitions orcommunities even upon slight changes to OSN graphs. Chen etal. [15] designed community detection algorithms to minimizethe inter-server communication of explicit interactions basedon the self-similar structure of interaction graphs. However,they did not study any data replication and did not considerthe latent interactions which account for the majority of userinteractions in OSNs [16].

III. PROBLEM FORMULATION

A. System Model

We consider an OSN service comprising a cluster of serversthat store user data. Each user has one master replica of herdata stored in her master server and possibly multiple slavereplicas stored in some slave servers. A user’s read and write

requests are always sent to her master server. When a user’sdata is updated, her master server would propagate the updateto all of her slave servers for synchronization. When a user ureads the data of another user v, if u’s master server does nothave v’s data, u’s master server would fetch the data from areplica of v and then return the result to u. This is known asthe relay model in distributed data access [17].

We model the connections between users in an OSN by asocial graph G = (V,E), where the set of nodes V representusers and the set of edges E represent the connections amongusers (e.g., friendships on Facebook, followships on Twitter).Without loss of generality, we assume that the social graph isdirected. The existence of an edge (u, v) does not necessarilyimply that an edge (v, u) also exists. For each directed edge(u, v) ∈ E, v is called a neighbor of u, and u is called aninverse neighbor of v. Let Nu denote the set of user u’sneighbors, i.e., Nu = {v : v ∈ V, (u, v) ∈ E}. For eachuser u and each server s, we define a binary variable Ms,u todescribe whether s is the master server of u. Ms,u = 1 meansthat u’s master replica is stored in server s and Ms,u = 0means otherwise. Similarly, we define another binary variableSs,u to describe whether there is a slave replica of user ustored in server s.

Inter-server communication occurs when a user reads herneighbors’ data stored in other servers or when her masterserver pushes a write update to her slave servers. Denote byru,v and wu the rates at which user u reads a neighbor v’sdata and writes her own data,1 respectively. We assume thatthe average data size returned by read operations is ψr andthe average data size of write updates is ψw. Let S be the setof servers. Then, the total inter-server traffic for all the readand write operations is given by

Ψ =ψr ·∑u∈V

∑v∈Nu

ru,v(

1−∑s∈S

Ms,u(Ms,v + Ss,v))

+ ψw ·∑u∈V

(wu ·

∑s∈S

Ss,u

),

(1)

where the first term represents the read-incurred traffic andthe second term represents the write-incurred traffic. In thefirst term,

∑s∈SMs,u (Ms,v + Ss,v) = 1 if and only if

a replica of user v is stored in user u’s master server.Thus, u’s read operation on v generates inter-server traf-fic if

∑s∈SMs,u (Ms,v + Ss,v) = 0. In the second term,∑

s∈S Ss,u represents the total number of u’s slave replicas.When writes are conducted on u’s data, the updates pushed toall her slave servers give rise to inter-server traffic.

B. Problem DefinitionIn the above model, the master server of a user needs to

handle much more workload than the slave servers. Thus, weuse the number of users having a server as their master serversas an indicator of the server load. Assume that each server hasa capacity limit of µ. Given a set of servers S, we are interestedin finding out the optimal data partitioning and replication that

1For simplicity, our model does not include the write updates made by auser on her neighbors’ data. From the traffic generated perspective, such anoperation can be considered as a combination of two operations: a user readinga neighbor’s data and the neighbor updating her own data. Our analysis andalgorithms can be easily generalized to handle cross-user writes.

Page 3: Optimizing Inter-Server Communication for Online Social

produce the minimum inter-server traffic subject to the servercapacity constraints. We formulate this problem by a zero-onequadratic program as follows:

min Ψ

s.t.∑s∈S

Ms,u = 1, ∀u ∈ V, (2)

Ms,u + Ss,u ≤ 1, ∀u ∈ V, s ∈ S, (3)∑u∈V

Ms,u ≤ µ, ∀s ∈ S, (4)

Ms,u, Ss,u ∈ {0, 1}, ∀u ∈ V, s ∈ S, (5)

where Ψ refers to the total inter-server traffic defined in Eq.(1). Constraint (2) ensures that there exists exactly one masterreplica of every user. Constraint (3) ensures that each user hasat most one replica stored in one server. Constraint (4) restrictseach server to host users up to its capacity limit. Constraint(5) regulates the status of the master or slave replica to beeither existing or non-existing.

C. Motivation for Joint Optimization

We use a simple example to illustrate the advantage of jointpartitioning and replication optimization. Fig. 1(a) shows asocial graph with 4 nodes. Each node is marked with a writerate and each edge is marked with a read rate. Suppose thatthere are two servers available, each having a capacity limitof µ = 2. We compare the inter-server traffic resulting fromdifferent methods of partitioning and replication, assuming forsimplicity that all the read and write operations involve thedata size of one unit.• RP (Fig. 1(b)) randomly partitions the social graph into

two equal size groups and stores them at the two serverswithout any replication. This is a case of no optimizationat all. Since RP does not perform replication, the writeoperations do not generate any inter-server communica-tion. But a total of 255 traffic units are produced for allthe read operations.

• RP+SR (Fig. 1(c)) adds selective replication [9] onto RPby creating replicas only if they can save the inter-servertraffic. This is a case of replication optimization withoutpartitioning optimization. RP+SR introduces 120 trafficunits for the write operations while reducing the trafficcaused by the read operations from 255 down to 15 units.Thus, the total inter-server traffic of RP+SR is 135 units,which is less than RP.

• METIS [11] (Fig. 1(d)) is a graph partitioning algo-rithm attempting to minimize the total weight of inter-partition edges. Since the edge weights in our socialgraph represent the read rates, applying METIS to ourproblem essentially minimizes the inter-server communi-cation assuming no replication is conducted. Thus, thisis a case of partitioning optimization without replicationoptimization. METIS brings down the traffic for the readoperations to 150 units and outperforms RP.

• METIS+SR (Fig. 1(e)) adds selective replication ontoMETIS. This represents a case conducting both partition-ing optimization and replication optimization, but the two

r=20r=100

r=100

r=20

r=5

r=10r=100

C

B

A

D

w=10 w=30

r=90r=25

r=5r=15

r=20 r=20

w=20 w=80

w=10

r=15

C

B

A

D

(c) RP+SR (total traffic: 135)Read-incurred traffic: 15Write-incurred traffic: 10+30+80=120

C

D

A w=30

w=80

C

B

A

D

r=90

r=15

B

C

A

D

(d) METIS (total traffic: 150)Read-incurred traffic: 20+100+20+10=150Write-incurred traffic: 0

(e) METIS+SR (total traffic: 110)Read-incurred traffic: 20Write-incurred traffic: 10+80=90

(a) Social graph

(b) RP (total traffic: 255)Read-incurred traffic: 25+90+20+100+15+5=255Write-incurred traffic: 0

r=25

Master replica

Slave replica

w=10

w=80

B

C

A

D

(f) SPAR (total traffic: 120)Read-incurred traffic: 0Write-incurred traffic: 10+30+80=120

D C

A

w=30

w=10

r=5 BD

A C

(g) Min. achievable traffic: 70Read-incurred traffic: 10+5+15=30Write-incurred traffic: 10+30=40

A

r=10

C

r=15

w=30

r=20

r=10 w=80BC

A

DD

A w=10

r=20

Fig. 1. An example to motivate joint partitioning and replication optimization.

optimizations are performed separately. METIS+SR canfurther reduce the total inter-server traffic to 110 units.

• SPAR [6] (Fig. 1(f)) optimizes partitioning to mini-mize the number of replicas required for co-locating theneighbors on the same servers. This is again a case ofpartitioning optimization without replication optimizationas slave replicas are blindly created for all pairs ofneighbors. Since SPAR guarantees perfect social localityof data storage, no inter-server communication is neededfor the read operations, but a total of 120 traffic units aregenerated by the write operations.

• Unfortunately, none of the above methods achieves theminimum inter-server traffic. The best solution is tooptimize partitioning and replication in an integratedmanner as shown in Fig. 1(g). Such joint optimizationproduces the lowest possible inter-server traffic of only70 units, which is much less than all the earlier methods.

This example shows the importance of optimizing partition-ing and replication together. Motivated by this observation, innext section, we develop a Traffic-Optimized Partitioning andReplication (TOPR) method for distributed OSN data storage.

IV. DESIGN OF TOPR

The problem defined in Section III-B is NP-hard. Moreover,OSNs are highly dynamic due to constant changes in data

Page 4: Optimizing Inter-Server Communication for Online Social

access patterns, addition of new users, and creation/deletionof connections. Thus, rather than solving the optimizationproblem defined in Section III-B statically and offline, in thispaper, we focus on online heuristic methods that continuouslyadapt data partitioning and replication to the dynamics.

A. Preliminaries

We start by studying two basic issues of data partitioningand replication: (1) the optimal allocation of slave replicasgiven the master replicas; and (2) the change in the inter-servertraffic due to the movement of a master replica. They serve asthe building blocks in the design of our TOPR method.

Consider a user u. Let su denote u’s master server. For allthe other users whose master replicas are also hosted by su,their mutual read accesses with u do not introduce any inter-server traffic. Consider any other server s 6= su. For eachneighbor v of u that is hosted by s, v reads u’s data at therate of rv,u. Thus, the aggregate rate of server s reading useru’s data is given by

Rs,u =∑

v∈Iu∩Ms

rv,u,

where Iu = {v : v ∈ V, (v, u) ∈ E} is the set of u’s inverseneighbors, and Ms denotes the set of master replicas hostedby s. If there is no slave replica of u on server s, the inter-server traffic between s and su due to read operations on u isψr ·Rs,u. If a slave replica of u is created on server s, therewould be no read-incurred traffic between s and su, but anamount of ψw ·wu write-incurred traffic would be introducedbetween s and su for synchronizing the slave with the master.Therefore, to minimize the inter-server traffic, a slave replicaof u should be created on server s if and only if

ψw · wu < ψr ·Rs,u.

It can be seen that the optimal allocation of slave replicas iscompletely determined by the locations of master replicas, andthe optimal allocation can be constructed separately for eachuser and each server. Algorithm 1 decides whether to create aslave replica of a user u on a server s, where Ls denotes theset of slave replicas hosted by s.

Algorithm 1: allocateSlave(u, s)

1 if ψrRs,u > ψwwu then2 Ls ← Ls ∪ {u};3 else4 Ls ← Ls \ {u};

We refer to the traffic between two servers caused by readand write operations on user u as the u-relevant traffic. Then,the u-relevant traffic between su and s under the optimalallocation of u’s slave replicas is

min{ψw · wu, ψr ·Rs,u}.

Therefore, the total inter-server traffic under the optimal allo-cation of slave replicas given by∑

u∈V

∑s6=su

min{ψw · wu, ψr ·Rs,u}.

We now examine the impact of moving a master replicaon the inter-server traffic, assuming that the above optimal

allocation of slave replicas is implemented both before andafter the movement. Suppose that the master replica of auser u is moved from server su to another server s. Themovement could affect the u-relevant traffic between su ands as well as the traffic relevant to u’s neighbors involvingsu and s. Specifically, according to the above analysis, priorto the movement, the u-relevant traffic between su and s ismin{ψw ·wu, ψr ·Rs,u}. After moving u’s master replica to s,the u-relevant traffic becomes min{ψw ·wu, ψr ·Rsu,u}. Thus,the reduction in the u-relevant traffic is given by

min{ψw · wu, ψr ·Rs,u} −min{ψw · wu, ψr ·Rsu,u}.

For each neighbor v of u, if sv 6= su, before moving u’smaster replica, the v-relevant traffic between su and v’s masterserver sv is

Ψsu,v = min{ψw · wv, ψr ·Rsu,v}.

After moving u’s master replica away from su, the v-relevanttraffic between su and sv becomes

Ψ′su,v = min{ψw · wv, ψr · (Rsu,v − ru,v)}.

Similarly, if sv 6= s, before moving u’s master replica, thev-relevant traffic between s and sv is

Ψs,v = min{ψw · wv, ψr ·Rs,v}.

After moving u’s master replica to s, the v-relevant trafficbetween s and sv becomes

Ψ′s,v = min{ψw · wv, ψr · (Rs,v + ru,v)}.

Thus, the reduction in the v-relevant traffic is given by Ψs,v −Ψ′s,v if sv = su,Ψsu,v −Ψ′su,v if sv = s,Ψs,v −Ψ′s,v + Ψsu,v −Ψ′su,v otherwise.

Based on the above analysis, Algorithm 2 calculates thetotal traffic reduction by moving the master replica of a useru to another server s. The time complexity of Algorithm 2 isgiven by O(|Nu|), where |Nu| is the number of u’s neighbors.

Algorithm 2: calMoveMaster(u, s)

1 δ ← min{ψw · wu, ψr ·Rs,u} −min{ψw · wu, ψr ·Rsu,u};2 for each v ∈ Nu do3 if sv 6= s then4 δ ← δ + min{ψw · wv, ψr ·Rs,v}

−min{ψw · wv, ψr · (Rs,v + ru,v)};5 if sv 6= su then6 δ ← δ + min{ψw · wv, ψr ·Rsu,v}

−min{ψw · wv, ψr · (Rsu,v − ru,v)};

7 return δ;

B. TOPR Overview

To optimize the inter-server traffic, we propose a TOPRmethod that dynamically estimates the read and write ratesof the users, and adjusts the allocation of master and slavereplicas when these rates change. Algorithm 3 shows thepseudo code of the main algorithm. For each pair of neigh-bors u and v, we maintain the expected time interval tu,v

Page 5: Optimizing Inter-Server Communication for Online Social

Algorithm 3: TOPR1 while True do2 if a read operation is performed then3 (u, v)← the two users relevant to the read

operation (u reads v’s data);4 τ ← the time duration since the last read

operation of u on v;5 tu,v ← α · τ + (1− α) · tu,v;6 Rsu,v ← Rsu,v − ru,v + 1/tu,v;7 ru,v ← 1/tu,v;8 if ru,v/last ru,v 6∈ [1/θr, θr] then9 last ru,v ← ru,v;

10 checkRead(u, v);

11 else if a write operation is performed then12 u← the user performing the write operation;13 τ ← the time duration since the last write

operation of u;14 tu ← α · τ + (1− α) · tu;15 wu ← 1/tu;16 if wu/last wu 6∈ [1/θw, θw] then17 last wu ← wu;18 checkWrite(u);

between two successive read operations of u on v. Specifically,whenever u performs a read operation on v, we record thetime interval τ since her last read operation on v and updatethe estimate of tu,v using an Exponentially Weighted MovingAverage (EWMA) [18] (line 5). The read rate of u on v isthen computed as ru,v = 1/tu,v (line 7), and the aggregateread rate of server su on v is updated accordingly (line 6). Anaive implementation of TOPR is to check for possible replicaadjustments that can potentially reduce the inter-server trafficat every read operation. However, this strategy could introducehigh computational overheads due to the large volume of useroperations. It is intuitive that a slight change in the read rateof a user on a neighbor usually does not deserve any replicaadjustment. Thus, to reduce computational overheads, we usea threshold θr (θr ≥ 1.0) to guard the checking for possiblereplica adjustments. Possible replica adjustments are checkedand carried out only if the read rate ru,v has changed relativelyby more than a factor of θr since the last check (lines 8–10). When θr is set to 1.0, the algorithm degenerates to thebaseline case that checks for possible adjustments at everyread operation. The impact of the guard threshold on the inter-server traffic and computational overheads shall be evaluatedin our experiments (Section V-C).

Similarly, for each user u, we maintain the expected timeinterval tu between two successive write operations of u bythe EWMA (line 14). The write rate of user u is estimated aswu = 1/tu (line 15). Possible replica adjustments are checkedwhen wu has changed relatively by more than a factor of θw,where θw ≥ 1.0 is a guard threshold (lines 16–18).

C. Detailed Design

Algorithm 4 describes how to check and perform replicaadjustments upon read operations. When a user u conducts a

Algorithm 4: checkRead(u, v)

1 if su 6= sv then2 δ2 ← −∞;3 δ3 ← −∞;4 if |Msv |+ 1 ≤ µ then5 δ2 ← calMoveMaster(u, sv);

6 if |Msu |+ 1 ≤ µ then7 δ3 ← calMoveMaster(v, su);

8 if δ2 ≥ δ3 and δ2 > 0 then9 moveMaster(u, sv);

10 else if δ3 ≥ δ2 and δ3 > 0 then11 moveMaster(v, su);12 else13 allocateSlave(v, su);

Algorithm 5: moveMaster(u, s)

1 Msu ←Msu \ {u};2 Ms ←Ms ∪ {u};3 allocateSlave(u, su);4 Ls ← Ls \ {u};5 for each v ∈ Nu do6 Rsu,v ← Rsu,v − ru,v;7 Rs,v ← Rs,v + ru,v;8 if sv 6= su then9 allocateSlave(v, su);

10 if sv 6= s then11 allocateSlave(v, s);

12 su ← s;

read operation on another user v, if their master servers are thesame, no further action is required since u reading v does notinvolve any inter-server communication (line 1). Otherwise,we consider the following three possible adjustments: (1) keepthe master replicas of u and v unchanged; (2) move the masterreplica of u to v’s master server sv; and (3) move the masterreplica of v to u’s master server su. Note that, in case (1), itmay still be possible to adjust v’s slave replicas to reduce theinter-server traffic due to the change in the estimate of the readrate ru,v . We make use of Algorithm 2 to calculate the trafficreductions of cases (2) and (3) with respect to case (1) (lines4–7). Recall that the number of master replicas allocated toeach server cannot exceed the capacity limit of µ. So, cases(2) and (3) are checked only if the respective servers sv andsu have spare capacity to host more master replicas (lines 4and 6). Finally, the algorithm chooses the adjustment leadingto the lowest inter-server traffic and executes the adjustment(lines 8–13).

Algorithm 5 performs the relevant updates when the masterreplica of a user u is moved to a server s. First, the sets ofmaster replicas hosted by the existing master server su andthe new master server s are updated (lines 1–2). Then, theoptimal allocation of u’s slave replica at su after the movementis calculated using Algorithm 1 (line 3). Since s has becomethe new master server of u, u’s slave replica at s (if any) isremoved (line 4). Due to the change of u’s master replica, for

Page 6: Optimizing Inter-Server Communication for Online Social

Algorithm 6: checkWrite(u)

1 δ2 ← −∞;2 δ3 ← −∞;3 for each s ∈ S \ {su} do4 if |Ms|+ 1 ≤ µ then5 δ ← calMoveMaster(u, s);6 if δ > δ2 then7 δ2 ← δ;8 s∗ ← s;

9 if |Msu |+ 1 ≤ µ then10 for each v ∈ Iu \Msu do11 δ ← calMoveMaster(v, su);12 if δ > δ3 then13 δ3 ← δ;14 v∗ ← v;

15 if δ2 ≥ δ3 and δ2 > 0 then16 moveMaster(u, s∗);17 else if δ3 ≥ δ2 and δ3 > 0 then18 moveMaster(v∗, su);

19 for each s ∈ S \ {su} do20 allocateSlave(u, s);

each neighbor v of u, the aggregate read rates of su and s onv should be updated (lines 6–7), and the optimal allocation ofv’s slave replicas at su and s is re-computed as well (lines8–11).

Algorithm 6 describes how to check and perform replicaadjustments upon write operations. When a user u conducts awrite operation on her data, we consider the following threepossible adjustments: (1) keep the master replicas of u andher neighbors unchanged; (2) move the master replica of uto the master server of one of u’s inverse neighbors; and (3)move the master replica of one of u’s inverse neighbors tou’s master server su. Again, in case (1), it may be possible toadjust u’s slave replicas to reduce the inter-server traffic dueto the change in the estimate of the write rate wu. For case(2), we use Algorithm 2 to find the best server s∗ for hostingu’s master replica (lines 3–8). Due to the capacity limit ofservers, we consider only the servers that can accommodatemore master replicas (line 4). For case (3), we attempt toselect the best inverse neighbor v∗ of u that would reduce theinter-server traffic most if its master replica is moved to serversu (lines 9–14). To account for the capacity limit, case (3) ischecked only if server su has not been filled to its capacity(line 9–14). Finally, the algorithm chooses the adjustment thatwould result in the lowest inter-server traffic and executes theadjustment (lines 15–20).

D. Other Events

In OSNs, there are several types of events that change thetopology of the social graph, including adding and removingnodes (users) and edges (connections). These events are morestraightforward to handle than read and write operations. Whena new user is created, it does not have any neighbor yet. Forthe purpose of load balancing, we simply allocate the master

replica of the new user to the server hosting the minimumnumber of master replicas. When an existing user u is deleted,we remove all of u’s replicas, including the master and theslaves. Meanwhile, at u’s master server, the slave replicas ofu’s neighbors are adjusted according to Algorithm 1 to accountfor the removal of the edges incident on u. When a new edgeis added from user u to user v, the read rate ru,v is initializedto be 0 since there is no read operation yet. As a result, thenew edge would not affect the allocation of slave replicas andno further action is required. When an existing edge fromu to v is removed, if their master servers are not the same,v’s slave replica at u’s master server is adjusted according toAlgorithm 1.

E. Discussions

The time complexity of TOPR is mainly determined bythat of the routines checkRead() and checkWrite().For checkRead() (Algorithm 4), calculating the potentialtraffic reductions of cases (2) and (3) by Algorithm 2 takesO(|Nu|) and O(|Nv|) time respectively, where |Nu| and|Nv| are the numbers of u and v’s neighbors. The selectedadjustment moves at most one master replica. So, Algorithm5 takes O(max{|Nu|, |Nv|}) time to perform the adjust-ment. Thus, the total time complexity of checkRead() isO(|Nu|)+O(|Nv|)+O(max{|Nu|, |Nv|}) = O(|Nu|+|Nv|).For checkWrite() (Algorithm 6), using Algorithm 2 to de-termine the best server to host u in case (2) takes O(|Nu|×|S|)time, where |S| is the number of servers. Selecting the bestinverse neighbor of u to move in case (3) by Algorithm 2 takesO(

∑v∈Iu |Nv|) time, where O(

∑v∈Iu |Nv|) is the number of

users sharing an inverse neighbor with u in the social graph.The selected adjustment again moves at most one masterreplica. Thus, performing the adjustment using Algorithm 5takes O(max{|Nu|,maxv∈Iu{|Nv|}}) time. Therefore, thetotal time complexity of checkWrite() is O(|Nu| × |S| +∑

v∈Iu |Nv|). As can be seen, both checkRead() andcheckWrite() are lightweight as they involve only thenodes in the immediate neighborhood of u and v.

V. PERFORMANCE EVALUATION

A. Experimental Setup

Two OSN social graphs are selected from [19] to evaluateour algorithms: a Facebook social graph consisting of 4, 039nodes and 88, 234 edges, and a Twitter social graph comprisedof 81, 306 nodes and 1, 768, 149 edges. The Facebook graphis undirected and the Twitter graph is directed.

OSN providers seldom publish the data of user activi-ties either for commercial competition or privacy protectionpurposes. Today, most OSN providers also deploy variousmechanisms to defend against crawlers [20]. Thus, it is dif-ficult to get the traces of interactions between OSN users.Two earlier studies [16], [21] used clickstreams to analyzehow users interact in OSNs and observed that 92% of useractivities on OSNs are profile browsing, which implies thatthe majority of user interactions are latent interactions. Jianget al. [22] performed a detailed measurement and constructed

Page 7: Optimizing Inter-Server Communication for Online Social

latent interaction graphs. Similar to other work [10], we usethe features reported by these empirical studies to generateuser interactions for our simulations.

Specifically, the sets of read rates and write rates for allusers are first generated from the power-law distribution withan exponent of 3.5 [22]. Following the statistics reported in[16], the ratio between the total read rate and total write rateis set at 0.92/0.08. Then, each user is assigned a read rate anda write rate from the above sets. In this process, we controlthe Spearman’s rank correlation coefficient [23] between theread/write rate of each user and her social degree (the numberof her neighbors in the social graph), which is set to 0.7 [22].The write rate assigned to each user represents the rate atwhich the user updates her data. The read rate assigned toeach user represents the aggregate rate at which she reads all ofher neighbors. After that, the aggregate read rate is distributedamong the neighbors following the preferential model in [24].That is, the read rate on each neighbor is set proportional toits social degree. After the distribution, the mean read rates onedges are 0.48 per unit time for Facebook and 0.79 for Twitter,and the mean write rates of users are 1.93 for Facebookand 1.66 for Twitter. Finally, we use the Poisson process togenerate the sequence of read and write operations for eachuser according to the assigned rates. We assume an emptysocial graph at the beginning. The first operation relevant toeach user is treated as an event of creating a new user (i.e.,adding a node to the social graph). Similarly, the first readoperation involving a pair of neighbors is treated as an eventof establishing a connection (i.e., adding an edge to the socialgraph).

The main performance metric used in our evaluation isthe total inter-server traffic among a given set of servers.Each read operation is assumed to return a normalized datasize of ψr = 1. The data size ψw of each write operationis varied to reflect different ratios between read and writetraffic. By default, ψw is set to 1. We assume that thereare 64 servers available, and all the servers have the samecapacity limit. Thus, the minimum requirement of the servercapacity is d 403964 e = 64 for the Facebook social graph andd 8130664 e = 1271 for the Twitter social graph. The servercapacity limit is set by multiplying the minimum requirementby a factor f (f ≥ 1) which represents the over-provisioninglevel of server resources. The larger the factor f , the moreflexible the data partitioning among servers. The default valueof f is set at 1.0, i.e., the capacity limit is equal to theminimum requirement.

We compare our proposed TOPR method with the methodsdescribed in Section III-C.

Random Partitioning: As mentioned earlier, random parti-tioning is the de facto default distributed storage mechanismfor most popular OSNs. We implement the basic method ofrandom partitioning without replication (RP), in which noslave replica is created for any user.

METIS: METIS [11] conducts graph partitioning to opti-mize the inter-server communication assuming no replication.Since METIS is an offline algorithm, it cannot dynamically

adapt data partitioning on the fly. In our experiments, we countthe numbers of reads and writes in the operation sequence andpre-compute the METIS partitioning using these statistics. Theoperation sequence is then simulated to measure the inter-server traffic. In this way, our evaluation gives METIS anunfair advantage of having a priori knowledge on the dataaccess pattern.

Selective Replication: We apply the selective replicationscheme of SD3 [9] to the data partitions created by the randompartitioning and METIS methods. Specifically, slave replicasare created only if they can reduce the total inter-server traffic.The replication decisions are dynamically made using real-time EWMA estimates of read and write rates. The resultantmethods are referred to as random partitioning with selectivereplication (RP+SR) and METIS with selective replication(METIS+SR).

SPAR: SPAR [6] performs replication with perfect sociallocality. That is, for each user, a slave replica is stored inthe master server of each of her neighbors. SPAR carefullyplans data partitioning to minimize the total number of replicascreated.

Among the above methods, RP+SR, METIS+SR and TOPRneed dynamic estimations of data read and write rates foradjusting replications on the fly. By default, the factor α forEWMA estimations in these methods is set at 0.5. The defaultguard thresholds θr and θw for checking possible replicaadjustments in our proposed TOPR method are set at 1.0.

B. Comparison of Different Methods

Fig. 2 shows the instantaneous inter-server traffic per unittime produced by different methods under the default param-eter settings. The first 10 time units is a warm-up period formost users to join the OSN. After that, among the methodstested, RP produces the highest inter-server traffic as there isno optimization at all. METIS reduces the inter-server trafficsignificantly compared to RP even though it does not conductreplication either. By creating slave replicas that save moreread-incurred traffic than the write-incurred traffic introduced,selective replication considerably cuts the inter-server trafficfor different partitioning methods. As shown in Fig. 2, RP+SRand METIS+SR outperform RP and METIS respectively.However, in these two methods, selective replication is carriedout separately from partitioning. Our proposed TOPR methodoptimizes partitioning and replication in an integrated manner,and performs the best among all the methods tested. Asseen from Fig. 2, on average, TOPR reduces reduces theinter-server traffic by 75.3% (Facebook) and 87.7% (Twitter)over RP+SR and by 35.5% (Facebook) and 83.9% (Twitter)over METIS+SR. This demonstrates the effectiveness of jointpartitioning and replication optimization. The SPAR method,which considers the structure of the social graph in the par-titioning and conducts replication with perfect social locality,performs between RP+SR and METIS+SR. This implies thataggressively maximizing the social locality of replication isnot very effective for reducing the inter-server traffic.

Page 8: Optimizing Inter-Server Communication for Online Social

0 20 40 60 80 100Time

0

1

2

3

4

5

6

7

8

9In

ter-

serv

ertr

affic

1e4

RP

RP+SR

SPAR

TOPR

METIS

METIS+SR

(a) Facebook

0 20 40 60 80 100Time

0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

Inte

r-se

rver

traf

fic

1e6

RP

RP+SR

SPAR

TOPR

METIS

METIS+SR

(b) Twitter

Fig. 2. Inter-server traffic

0 20 40 60 80 100Time

0.0

0.5

1.0

1.5

2.0

Num

ber

ofsl

ave

repl

icas

1e4

RP+SR

SPAR

TOPR

METIS+SR

(a) Facebook

0 20 40 60 80 100Time

0.0

0.5

1.0

1.5

2.0

2.5

3.0

Num

ber

ofsl

ave

repl

icas

1e5

RP+SR

SPAR

TOPR

METIS+SR

(b) Twitter

Fig. 3. Number of slave replicas

0 20 40 60 80 100Time

0

1

2

3

4

5

6

7

8

Inte

r-se

rver

traf

fic

1e4

RP+SR (α = 0.2)

RP+SR (α = 0.5)

RP+SR (α = 0.8)

METIS+SR(α = 0.2, 0.5, 0.8)

TOPR(α = 0.2, 0.5, 0.8)

(a) Facebook

0 20 40 60 80 100Time

0

1

2

3

4

5

6

7

8

Inte

r-se

rver

traf

fic

1e5

RP+SR (α = 0.2)

RP+SR (α = 0.5)RP+SR (α = 0.8)

METIS+SR (α = 0.2)

METIS+SR (α = 0.5)

METIS+SR (α = 0.8)

TOPR(α = 0.2, 0.5, 0.8)

(b) Twitter

Fig. 4. Impact of EWMA estimation

TABLE IAMORTIZED NUMBER OF REPLICA MOVEMENTS PER USER OPERATION.

RP+SR METIS+SR TOPRFacebook 0.081175 0.027212 0.017224

Twitter 0.054469 0.038767 0.006626

The methods that dynamically adjust replications wouldproduce overheads on the inter-server traffic by moving mas-ter/slave replicas based on real-time data access patterns.Table I compares the amortized number of replica movementsper read/write operation for RP+SR, METIS+SR and TOPR.As can be seen, the overheads are minor compared to the trafficgenerated by processing user-initiated read/write operations. Inparticular, the proposed TOPR method has much lower trafficoverheads than RP+SR and METIS+SR. Thus, integrated op-timization of partitioning and replication also helps to reducethe traffic overheads.

Fig. 3 compares the total number of slave replicas created bydifferent methods over time. It can be seen that TOPR resultsin much fewer slave replicas than all the other methods exceptRP and METIS (which do not perform replication at all). Thisimplies that besides reducing the inter-server traffic, TOPRalso significantly decreases the storage cost of replication.Since SPAR maintains perfect social locality of data storage,it creates the highest number of slave replicas.

C. Sensitivity of TOPR to Algorithm Parameters

Fig. 4 explores the effect of the EWMA function forestimating the read and write rates. Only the methods withselective replication (RP+SR, METIS+SR and TOPR) makeuse of the estimated read and write rates to dynamically adjust

data replications. We evaluate their performance using threedifferent α values (0.2, 0.5 and 0.8) in the EWMA function.As shown in Fig. 4, the performance variation of each methodis within 20% over different α values. This implies that thesemethods are not very sensitive to α. The relative performanceof these methods keeps similar for different α values.

Next, we study the impact of TOPR’s guard thresholdsθr and θw. Fig. 5 shows the proportions of read and writeoperations at which checks are performed when θr and θw arevaried from 1.0 to 2.0. It can be seen that even small guardthresholds can reduce the number of checks significantly. Forexample, θr = θw = 1.2 reduces the number of checks bymore than 20% compared to that of θr = θw = 1.0. Largerthresholds of θr = θw = 2.0 can cut the number of checks byover 75%. Thus, the guard thresholds are useful for reducingthe computational overheads of TOPR. Fig. 6 shows the inter-server traffic of TOPR for different thresholds θr and θw. Ascan be seen, the threshold values do not affect the inter-servertraffic much. Larger thresholds just make it slightly slower forreplica allocation in TOPR to converge.

D. Impacts of Various System Parameters

Finally, we study the impacts of various system parameters.In these experiments, we plot the average inter-server trafficper time unit by different methods for comparison. Fig. 7shows the impact of server capacity limit, where we varythe over-provisioning factor f from 1.0 to 1.5. Larger servercapacities allow more users that are strongly connected inthe social graph to be allocated the same master server.This reduces the number of slave replicas needed to main-tain the social locality of data storage and thus the inter-

Page 9: Optimizing Inter-Server Communication for Online Social

θr = θw = 1.0 θr = θw = 1.2 θr = θw = 1.5 θr = θw = 2.0

Guard thresholds0%

20%

40%

60%

80%

100%F

ract

ion

ofop

erat

ions

wit

hch

ecki

ngreadwrite

(a) Facebook

θr = θw = 1.0 θr = θw = 1.2 θr = θw = 1.5 θr = θw = 2.0

Guard thresholds0%

20%

40%

60%

80%

100%

Fra

ctio

nof

oper

atio

nsw

ith

chec

king

readwrite

(b) Twitter

Fig. 5. Workload of checking

0 20 40 60 80 100Time

0

1

2

3

4

5

6

7

8

Inte

r-se

rver

traf

fic

1e4

TOPR: θr = θw = 1.0

TOPR: θr = θw = 1.2

TOPR: θr = θw = 1.5

TOPR: θr = θw = 2.0

(a) Facebook

0 20 40 60 80 100Time

0

1

2

3

4

5

6

7

8

Inte

r-se

rver

traf

fic

1e5

TOPR: θr = θw = 1.0

TOPR: θr = θw = 1.2

TOPR: θr = θw = 1.5

TOPR: θr = θw = 2.0

(b) Twitter

Fig. 6. Impact of guard threshold

1.0 1.1 1.2 1.3 1.4 1.5Over-provisioning factor f

0

1

2

3

4

5

6

7

8

Inte

r-se

rver

traf

fic

1e4

SPARMETISMETIS+SRTOPR

(a) Facebook

1.0 1.1 1.2 1.3 1.4 1.5Over-provisioning factor f

0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

Inte

r-se

rver

traf

fic

1e6

SPARMETISMETIS+SRTOPR

(b) Twitter

Fig. 7. Impact of server capacity

server communication. Therefore, as shown in Fig. 7, theinter-server traffic generally decreases with increasing servercapacity for all the four methods that conduct social-awarepartitioning (SPAR, METIS, METIS+SR, and TOPR). OurTOPR method consistently outperforms SPAR, METIS andMETIS+SR throughout the range of the over-provisioning fac-tor tested. It can also be seen that when the over-provisioningfactor is large, the inter-server traffic of METIS+SR can bequite close to that of TOPR. This implies that in such cases,the METIS partitioning together with selective replication mayreasonably approximate the optimization problem defined inSection III-B. However, it should be borne in mind that wehave assumed a priori knowledge of the data access pattern incomputing the METIS partitioning, and METIS is an offlinealgorithm that is hard to use for real practice.

Fig. 8 shows the inter-server traffic of different methods fordifferent numbers of servers. The inter-server traffic generallyincreases with the server number. This is because when thenumber of servers increases, more pairs of neighbors have tobe assigned to different servers. As seen from Fig. 8, TOPRalways produces less traffic than all the other methods.

Tables II and III report the inter-server traffic of differentmethods normalized by that of TOPR over a wide range of ψw

values (the data size of a write operation). Recall that the datasize ψr of a read operation is fixed at 1. When ψw = 0.01,the read operations are much more data-intensive than writeoperations. In this case, selective replication attains nearlyperfect social locality in data storage. With nearly perfectsocial locality, the inter-server traffic of RP+SR, METIS+SRand TOPR is dominated by the write-incurred traffic justlike SPAR. Note that SPAR, RP+SR and METIS+SR do not

16 32 64 128 256Number of servers

0.0

0.2

0.4

0.6

0.8

1.0

Inte

r-se

rver

traf

fic

1e5RPRP+SRSPARMETISMETIS+SRTOPR

(a) Facebook

16 32 64 128 256Number of servers

0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

1.6

Inte

r-se

rver

traf

fic

1e6RPRP+SRSPARMETISMETIS+SRTOPR

(b) Twitter

Fig. 8. Impact of the number of servers

differentiate the users by their write rates in the partitioning.As a result, their inter-server traffic is 1.25 to 9.40 times higherthan our proposed TOPR method. On the other hand, RPand METIS, which do not perform any replication, produce

Page 10: Optimizing Inter-Server Communication for Online Social

TABLE IIINTER-SERVER TRAFFIC NORMALIZED BY TOPR ON FACEBOOK.

ψw RP RP+SR SPAR METIS METIS+SR TOPR0.01 273.20 8.52 1.25 197.16 1.84 1.000.1 33.11 8.51 1.52 23.90 1.89 1.001 5.63 4.05 2.58 4.06 1.55 1.00

10 2.33 1.95 10.69 1.68 1.16 1.00100 1.89 1.94 86.50 1.36 1.22 1.00

TABLE IIIINTER-SERVER TRAFFIC NORMALIZED BY TOPR ON TWITTER.

ψw RP RP+SR SPAR METIS METIS+SR TOPR0.01 519.23 9.40 2.05 456.67 6.66 1.000.1 79.04 10.00 3.11 69.52 6.98 1.001 17.24 8.12 6.79 15.16 6.23 1.00

10 5.91 5.06 23.30 5.20 4.34 1.00100 3.52 3.56 138.71 3.10 3.13 1.00

the inter-server traffic two orders of magnitude higher thanthe other methods. When ψw increases, less slave replicasare created by selective replication. Hence, the performancegap between RP (METIS) and RP+SR (METIS+SR) demotes.When ψw = 100, the write operations are much more data-intensive than the read operations. In this case, selectivereplication loses incentives to create slave replicas. As aresult, RP+SR and METIS+SR degenerate to RP and METISrespectively. Their inter-server traffic is dominated by the read-incurred traffic. Since RP+SR does not capture the actual readrates in the partitioning, its inter-server traffic is 1.94 to 3.56times higher than that of TOPR. METIS+SR performs betterthan RP+SR, but its traffic is still substantially higher thanTOPR. SPAR produces a lot more inter-server traffic thanthe other methods because it creates a large number of slavereplicas to guarantee perfect social locality of data storage.In summary, Tables II and III show that our proposed TOPRmethod consistently produces much lower inter-server trafficthan all the other methods across different intensities of read-incurred and write-incurred traffic.

VI. CONCLUSION

Optimizing the inter-server traffic is a critical issue in thedesign of distributed data storage systems for OSNs. In thispaper, we have formally defined an optimization problemfor minimizing the inter-server traffic among a cluster ofOSN servers and proposed a method called TOPR to addressthe problem. TOPR carries out social-aware partitioning andadaptive replication of user data in an integrated manner.Lightweight algorithms are developed for adjusting partition-ing and replication on the fly based on real-time data read andwrite rates. Evaluations with the Facebook and Twitter socialgraphs show that TOPR not only reduces the inter-server trafficsignificantly but also saves much storage cost of replicationcompared to state-of-the-art methods.

ACKNOWLEDGMENT

This research is supported by the Singapore National Re-search Foundation under its IDM Futures Funding Initiative

and administered by the Interactive & Digital Media Pro-gramme Office, Media Development Authority. This researchis also supported by Academic Research Fund Tier 1 GrantRG29/13.

REFERENCES

[1] Nielsen, “State of the media: The social media report 2012,”http://www.nielsen.com/us/en/insights/reports/2012/state-of-the-media-the-social-media-report-2012.html, Online report, December 2012.

[2] D. A. Tran, Data Storage for Social Networks: A Socially AwareApproach, ser. SpringerBrief in Optimization Series. Springer, 2012.

[3] A. Lakshman and P. Malik, “Cassandra: A decentralized structuredstorage system,” SIGOPS Oper. Syst. Rev., vol. 44, no. 2, pp. 35–40,Apr. 2010.

[4] G. DeCandia, D. Hastorun, M. Jampani, G. Kakulapati, A. Lakshman,A. Pilchin, S. Sivasubramanian, P. Vosshall, and W. Vogels, “Dynamo:Amazon’s highly available key-value store,” SIGOPS Oper. Syst. Rev.,vol. 41, no. 6, pp. 205–220, Oct. 2007.

[5] F. Chang, J. Dean, S. Ghemawat, W. C. Hsieh, D. A. Wallach, M. Bur-rows, T. Chandra, A. Fikes, and R. E. Gruber, “Bigtable: A distributedstorage system for structured data,” ACM Trans. Comput. Syst., vol. 26,no. 2, pp. 1–26, Jun. 2008.

[6] J. M. Pujol, V. Erramilli, G. Siganos, X. Yang, N. Laoutaris, P. Chhabra,and P. Rodriguez, “The little engine(s) that could: Scaling online socialnetworks,” in Proc. ACM SIGCOMM, 2010, pp. 375–386.

[7] L. Jiao, J. Li, T. Xu, and X. Fu, “Cost optimization for online socialnetworks on geo-distributed clouds,” in Proc. IEEE ICNP, 2012.

[8] D. A. Tran, K. Nguyen, and C. Pham, “S-clone: Socially-aware datareplication for social networks,” Comput. Netw., vol. 56, no. 7, pp. 2001–2013, May 2012.

[9] G. Liu, H. Shen, and H. Chandler, “Selective data replication for onlinesocial networks with distributed datacenters,” in Proc. IEEE ICNP, 2013.

[10] L. Jiao, J. Li, W. Du, and X. Fu, “Multi-objective data placement formulti-cloud socially aware services,” in Proc. IEEE INFOCOM, 2014,pp. 28–36.

[11] G. Karypis and V. Kumar, “A fast and high quality multilevel schemefor partitioning irregular graphs,” SIAM J. Sci. Comput., vol. 20, no. 1,pp. 359–392, Dec. 1998.

[12] S. Arora, S. Rao, and U. Vazirani, “Expander flows, geometric embed-dings and graph partitioning,” J. ACM, vol. 56, no. 2, pp. 5:1–5:37, Apr.2009.

[13] M. E. Newman, “Modularity and community structure in networks,”Proc. Nat. Acad. Sci. (PNAS), vol. 103, no. 23, pp. 8577–8582, 2006.

[14] V. D. Blondel, J.-L. Guillaume, R. Lambiotte, and E. Lefebvre, “Fastunfolding of communities in large networks,” Journal of StatisticalMechanics: Theory and Experiment, vol. 2008, no. 10, p. P10008, 2008.

[15] H. Chen, H. Jin, N. Jin, and T. Gu, “Minimizing inter-server communi-cations by exploiting self-similarity in online social networks,” in Proc.IEEE ICNP, 2012.

[16] F. Benevenuto, T. Rodrigues, M. Cha, and V. Almeida, “Characterizinguser behavior in online social networks,” in Proc. ACM IMC, 2009, pp.49–62.

[17] N. Tran, M. K. Aguilera, and M. Balakrishnan, “Online migration forgeo-distributed storage systems,” in Proc. USENIX ATC, 2011.

[18] S. W. Roberts, “Control chart tests based on geometric moving aver-ages,” Technometrics, vol. 1, no. 3, pp. 239–250, 1959.

[19] J. McAuley and J. Leskovec, “Learning to discover social circles in egonetworks.” in NIPS, 2012.

[20] M. Mondal, B. Viswanath, A. Clement, P. Druschel, K. P. Gummadi,A. Mislove, and A. Post, “Defending against large-scale crawls in onlinesocial networks,” in Proc. ACM CoNEXT, 2012, pp. 325–336.

[21] F. Schneider, A. Feldmann, B. Krishnamurthy, and W. Willinger, “Un-derstanding online social network usage from a network perspective,”in Proc. ACM IMC, 2009, pp. 35–48.

[22] J. Jiang, C. Wilson, X. Wang, P. Huang, W. Sha, Y. Dai, and B. Y. Zhao,“Understanding latent interactions in online social networks,” in Proc.ACM IMC, 2010, pp. 369–382.

[23] C. Spearman, “The proof and measurement of association between twothings,” The American Journal of Psychology, vol. 15, no. 1, pp. 72–101,1904.

[24] I. Hoque and I. Gupta, “Disk layout techniques for online social networkdata,” IEEE Internet Computing, vol. 16, no. 3, pp. 24–36, May 2012.