Linkbench: a Database Benchmark Based on the Facebook Social Graph

Linkbench: a Database Benchmark Based on the Facebook Social Graph

LinkBench: a Database Benchmark based on the Facebook Social Graph Timothy G. Armstrong∗1, Vamsi Ponnekanti2, Dhruba Borthakur2, and Mark Callaghan2 1Department of Computer Science, University of Chicago 2Database Engineering Team, Facebook, Inc. ABSTRACT alternative database systems to be used. Database benchmarks are an important tool for database re- Given the scale of Facebook's infrastructure, any changes searchers and practitioners that ease the process of making in technology require careful evaluation and testing. For ex- informed comparisons between different database hardware, ample, in the past we performed a thorough evaluation of software and configurations. Large scale web services such HBase [4] as an alternative social graph storage backend. as social networks are a major and growing database appli- Facebook already uses HBase for major applications includ- cation area, but currently there are few benchmarks that ing its messaging backend [5]. Its benefits include easier load accurately model web service workloads. balancing, failover and strong random write performance. In this paper we present a new synthetic benchmark called To accurately compare performance of MySQL and HBase, LinkBench. LinkBench is based on traces from production we mirrored part of the production workload on \shadow" databases that store \social graph" data at Facebook, a ma- clusters running our tuned and enhanced versions of MySQL jor social network. We characterize the data and query and HBase. Contrary to expectation, MySQL slightly out- workload in many dimensions, and use the insights gained to performed HBase in latency and throughput while using a construct a realistic synthetic benchmark. LinkBench pro- fraction of the CPU and I/O capacity. Further experiment vides a realistic and challenging test for persistent storage details are in Appendix A of social and web service data, filling a gap in the available The UBase benchmark effort took a lot of time and hard tools for researchers, developers and administrators. work to run and we want a more efficient way to evalu- ate alternative database solutions. Assessing new database systems will be crucial in the near future due to hardware 1. INTRODUCTION trends such as solid state storage and increasing core counts. Much of the data powering Facebook is represented as These new technologies could allow impressive performance a social graph, comprised of people, pages, groups, user- gains, but systems well-suited to the previous bottleneck of generated content and other entities interconnected by edges rotating disks cannot always exploit the I/O capacity of solid representing relationships. Such graph data models have be- state drives, or the processing power of many-core. Signifi- come popular as sophisticated social web services proliferate. cant efforts are underway in industry and academia to better At Facebook, persistent storage for the social graph is exploit this new generation of hardware, including key-value provided by an array of MySQL[1] databases called User stores such as FlashStore [6], SILT [7], embedded databases Databases (UDBs). Facebook's memcached and TAO cache such as WiredTiger [8] and new storage engines for relational clusters [2, 3] cache large amounts of UDB data in memory. databases such as TokuDB [9]. The vast majority of read requests hit in the cache, so the Many of these developments are promising, as are ongo- UDBs receive a production workload comprised of reads that ing efforts to improve and adapt current technologies such as miss the caches and all writes. MySQL/InnoDB. We intend to conduct ongoing benchmark- The Database Enginering team at Facebook has a growing ing on new and existing systems to guide decisions about the need for benchmarks that reflect this database workload to future of social graph storage at Facebook. Part of this plan assist with development, testing and evaluation of alterna- involves development of a database benchmark that closely tive database technologies. Facebook's software architecture approximates our production workloads abstracts storage backends for social graph data, allowing The contributions of this paper are: ∗Work done while at Facebook • A detailed characterization of the Facebook social graph workload using traces collected from production databases. • LinkBench, an open-source database benchmark1 that Permission to make digital or hard copies of all or part of this work for is closely based on our production workloads, and cus- personal or classroom use is granted without fee provided that copies are tomizable for variant and alternative workloads. not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SIGMOD ’12 New York, New York, USA 1 Copyright 20XX ACM X-XXXXX-XX-X/XX/XX ...$15.00. To be made available at https://github.com/facebook/ id int64 unique identifier 2. RELATED WORK type int32 type of object There are a number of existing widely accepted bench- version int64 tracks version of object marks for database systems, some of which have been devel- update time int32 last modification (UNIX timestamp) data text data payload oped in industry and some in academia. (a) Object (graph node). id is unique key. Mainstream database benchmarks do not closely match the Facebook UDB workload, so are of limited use. Transac- id1, id2 int64 ids of edge's endpoints atype int64 type of the association tional benchmarks such as TPC-C [10] are typically based on visibility int8 visibility mode of the edge business transaction-processing workloads and extensively timestamp int32 a client-provided sort key exercise the transaction handling properties required to main- data varchar small additional data payload tain ACID. Analytic benchmarks such as TPC-H [11] focus (b) Association (graph edge). (id1, atype, id2) is unique key. on complex queries that involve large table scans, joins and aggregation. The Facebook UDB workload places different Table 1: Database schema for social graph storage. demands on database systems from either type of bench- mark. Queries are fairly simple and short-lived with no full table scans or joins. While some ACID properties are re- typically entities which have some associated data. Associ- quired, transactions are simple and short-lived: the work- ations are a lightweight way to represent relationships be- load could be served by non-SQL database systems without tween objects, for example if a user posted a photo, a user general-purpose transactions. liked a photo, or if a user is friends with another user. Existing and proposed graph [12, 13] and object database Table 1 shows the schema used to represent objects and benchmarks [14] operate on graph-structured data, not dis- associations. The data fields are stored as a binary string. A similar to the social graph. These benchmarks have a signif- system at a higher level in the software stack supports richer icant focus on multi-hop traversals and other complex graph data types with per-object-type schemas which can then be analysis operations, unlike the simpler retrieval operations serialized into the data field. The version and update time that comprise the bulk of the Facebook workload. fields of the objects are updated with each change to the ob- The Yahoo Cloud Services Benchmark [15] is a bench- ject's data, with the version incremented and update time mark designed to measure performance of different database set to the current time. The timestamp field of an associa- systems, particularly distributed \cloud" database systems. tion is a general-purpose user-defined sort key (often a true The Facebook workload has similarities to the YSCB bench- timestamp), where high values are retrieved first. The vis- mark, but the data, supported operations, and workload mix ibility field allows data to be hidden without permanently are different. LinkBench's workload and data model is also deleting it, for example to allow a user to temporarily dis- grounded directly in measurements from production systems able their account. Only visible associations are included in to increase our confidence in the relevance of the benchmark. any query results (including counts). Additionally, we are specifically interested in performance of the persistent storage layer because we handle row-level 3.2 Sharding and Replication caching externally to the database. This focus simplifies un- The entire Facebook graph is far too large to fit on a single derstanding performance properties of design choices such server, so must be split into many shards. The nodes (ob- as disk storage layout, without confounding factors arising jects) in the graph are allocated to shards based on id, with from other design and implementation choices in a cloud a function mapping the id to a shard. Associations (edges) database's caching and replication design. are assigned to shards by applying the same mapping to id1, meaning that all out-edges for a node are in the same shard. 3. WORKLOAD CHARACTERIZATION Client applications have some control over the location of We aim to construct a synthetic benchmark which can newly created objects. For example, a new object could be predict with reasonable accuracy the performance of a data colocated with a related object (yielding some performance storage layer for the Facebook production workload, and benefit from locality), or assigned to a random shard. The more generally for other web services that use social or number of shards is chosen so that there are many shards graph-structured data. A synthetic benchmark has advan- per database instance, allowing rebalancing if necessary. tages in comparison to alternative approaches, such as cap- Each database instance has multiple replicas, with one turing and replaying traces. We can share the benchmark master and multiple slaves. Replicas are geographically dis- with the broader research community without any risk of tributed, with reads handled from local replicas, which re- compromising users' privacy.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us