Data Model

Figure 1. Conceptual data model of BG's database

Figure 1 shows the ER diagram of BG's database. The Member entity set contains those users with a registered profile. It consists of a unique identifier and a fixed number of string attributes whose length can be adjusted to generate different member record sizes. In addition, each member may have either zero or 2 images. With the latter, one is a thumbnail and the second is a higher resolution image. Typically, thumbnails are displayed when listing friends of a member and the higher resolution image is displayed when a member visits a profile. Thumbnail images are typically small (in the order of KBs) and their use (instead of larger images, in the order of tens and hundreds of KBs and MBs) has a dramatic impact on system performance.

A member may either extend an invitation to or be friends with another member. Both are captured using the "Friend" relationship set. An attribute of this relationship set (not shown) differentiates between invitations and friendships.A member may either extend an invitation to or be friends with another member. Both are captured using the "Friend" relationship set. An attribute of this relationship set (not shown) differentiates between invitations and friendships.

A resource may pertain to an image, a posted question, a technical manuscript, a comment, etc. These entities are captured in one set named "Resources". In order for a resource to exist, it must be "Owned" by a member, a binary relationship between a member and a resource. A member may post a resource, say an image, on the profile of another member, represented as a ternary relationship between two members and a resource. (In this relationship, the two members might be the same member where the member is posting the resource on her own profile). A member (either the owner or another) may comment on a resource (not shown). A member may restrict the ability to comment on a resource only to her friends implemented using the "Manipulation" relationship set.

Below, the logical design of the ER diagram is shown, with both relational and MongoDB's JSON-like data models. An evaluator builds a database using either BG's interface or configuration files that specify the number of members (M) in the social network, number of friends per member (Φ), and resources per member (ρ). Some of the relationships might be generated either uniformly or using a Zipfian distribution. For example, one may use a Zipfian distribution with exponent 0.27 to assign 80% of friendships (Φ) to 20% of members (M).

Relational data model of BG's database

Members (userid, username, pw, firstname, lastname, gender, job, jdate, ldate, address, email, tel)

Friends (userid1, userid2, status)

Resource (rid, creatorid, walluserid, type, body, doc)

Manipulation (mid, modifierid, rid, resourcecreatorid, timestamp, type, content)

JSON-like data model of BG's database