Big Table Distributed Storage System For Structured Data
Big Table: Distributed Storage System For Structured Data Sergejs Melderis Dennis Kafura – CS 5204 – Operating Systems 11
Big. Table Unstructured Data vs. Structured Data n Unstructured data refers to computerized information that either does not have a data model ¨ plain text, audio n Structured data can be described by data model ¨ Flat ¨ Hierarchical ¨ Network ¨ Relational ¨ Dimensional ¨ Object-relational Dennis Kafura – CS 5204 – Operating Systems 2
Big. Table Relational Model and RDBMS n most popular model of organizing structured data n model based on first-order predicate logic n provides a declarative method for specifying data and queries via SQL n data is organized in tables of fixed-length records n variety of open source and commercial implementations n provides ACID properties Dennis Kafura – CS 5204 – Operating Systems 33
Big. Table No. SQL n not relational database ¨ no fixed table schemas ¨ no join operations ¨ no sql n flexible and/or no data model n usually do not provide ACID properties n scale horizontally Dennis Kafura – CS 5204 – Operating Systems 44
Big. Table n distributed, high performance, fault-tolerant, No. Sql storage system build on top of Google File System n designed to scale to a very large size on low cost commodity hardware n it was designed by Google and used in various projects (web indexing) n the paper was published in 2006 n related implementations ¨ HBase ¨ Hypertable ¨ Apache Cassandra ¨ Neptune Dennis Kafura – CS 5204 – Operating Systems 55
Big. Table Data Model n sparse, distributed, persistent multi-dimensional sorted map n map is indexed by a row key, column family, column key, and a timestamp { row : { column_family : { column : { timestamp : value } } } Dennis Kafura – CS 5204 – Operating Systems 66
Big. Table Webtable “contents” “anchor: cnnsi. com t 6 “com. cnn. www” “<html>. . . ” “CNN” “anchor: my. look. ca” t 9 Dennis Kafura – CS 5204 – Operating Systems t 9 “CNN. com” 77
Big. Table Relational Data Model Student student_id - PK first_name last_name Student. Cours e Course student_id course crn title crn PK birthday type major instructor_id academic_level seats Dennis Kafura – CS 5204 – Operating Systems 88
Big. Table Student table Row Key Column Family Column Qualifier student_id Column Qualifier info course last_name <crn> first_name birthday major academic_level Dennis Kafura – CS 5204 – Operating Systems 9
Big. Table Course table Row Key Column Family Column Qualifier crn Column Qualifier info students course <student_id> title type instructor_id seats Dennis Kafura – CS 5204 – Operating Systems 10
Big. Table Example info: first_name “ 905514” “Sergejs” info: course “ 96322” “CS 5204” info: last_name “Melderis” info: title “Operating Systems” info: major courses: 96322 “Computer Science” info: instructor_id “YES” students: 905514 “ 1983943” Dennis Kafura – CS 5204 – Operating Systems “YES” courses: 96320 “NO” students: 905520 “YES” 11 11
Big. Table Students data view in JSON { 905514: { info : { first_name : { t 1 : Sergejs }, last_name : { t 1 : Melderis }, major : { t 1 : Comp Science } }, courses : { 96322: { t 1 : “YES” }, 96320: { t 2 : “NO” } } } Dennis Kafura – CS 5204 – Operating Systems 12 12
Big. Table Rows n row keys are arbitrary strings up to 64 KB n read and write of data under a single row is atomic n ordered in lexicographic order by row key n row range is dynamically partitioned into blocks called tablets n tablets are units of distribution and loadbalancing Dennis Kafura – CS 5204 – Operating Systems 13 13
Big. Table Columns n Column keys are grouped by column families n Column family is a basic unit of access control n All data stored in a column family is of the same type n Number of column families should be small n There can be unlimited number of columns n Column key is named using family: qualifier Dennis Kafura – CS 5204 – Operating Systems 14 14
Big. Table Timestamps n Bigtable can contain multiple versions of the same data n timestamps are 64 -bit integers assigned by Bigtable or client n client can specify to keep up to n versions of data Dennis Kafura – CS 5204 – Operating Systems 15 15
Big. Table Implementation n client library n one master server n distributed lock service called Chubby n many tablet servers containing several tablets n tablet server ¨ handles read and write requests ¨ automatically splits tablets that have grown too large (100 - 200 MB) n client data directly goes to tablet server Dennis Kafura – CS 5204 – Operating Systems 16 16
Big. Tablet Location n three-level hierarchy to store tablet location n first level is stored in lock service n root tablet contains the location of metadata tables n metadata tablets contain the location of user tables User. Table 1 METADATA tablets Lock Service Root tablet User. Table 2 Dennis Kafura – CS 5204 – Operating Systems 17
Big. Table Distribution of data n. One master server n. Chubby distributed lock service n. Hundred or thousands of tablet servers n. Each tablet contains a contiguous range of rows n. Master distributes tablets across of servers n. Each tablet server contains tablets with different ranges Dennis Kafura – CS 5204 – Operating Systems 18 18
Big. Tablet Representation memtable Read Op Memory GFS tablet log Write Op SSTable Dennis Kafura – CS 5204 – Operating Systems SSTable 19 19
Big. Table Compactions n compaction is a process of writing memtable to SSTable n minor compaction write memtable to SSTable ¨ shrinks the memory usage of the tablet server ¨ reduces the commit log n merging compaction merges several SSTables n major compaction rewrites all SSTables into exactly one SSTable Dennis Kafura – CS 5204 – Operating Systems 20 20
Big. Table API n create, delete tables and column families n write or delete values n look up values from individual rows n scan over a subset of the data in a table Dennis Kafura – CS 5204 – Operating Systems 21 21
Big. Table Dennis Kafura – CS 5204 – Operating Systems 22 22
- Slides: 22