Scalable Low-Latency Indexes for a Key-Value Store Ankita Kejriwal With Arjun Gopalan, Ashish Gupta, Zhihao Jia, Stephen Yang and John Ousterhout
Conjecture Can a key value store support strongly consistent secondary indexes while operating at low latency and large scale ? SLIK Slide 2
Summary of Results ● Scalable Low-latency Indexes for a Key-value Store: SLIK § Enables multiple secondary keys for each object § Allows lookups and range queries on these keys ● Key design features: § Scalability using independent partitioning § Strong consistency using an ordered write approach ● Implemented in RAMCloud § Low-latency, DRAM-based, distributed key-value store ● Performance: § Scalability: Linear throughput increase with increasing number of partitions § Low-latency:11-13 µ s indexed reads, 29-37 µ s durable writes/overwrites § Latency approximately 2x non-indexed reads and writes SLIK Slide 3
Talk Outline ● Motivation ● Design ● Performance ● Related Work ● Summary SLIK Slide 4
Motivation Traditional RDBMs MySQL SLIK Slide 5
Motivation + scalability Traditional NoSQL RDBMs Systems - data models - consistency MySQL SLIK Slide 6
Motivation + consistency H-Base Espresso RAMCloud Yesquel Spanner + scalability Megastore Traditional NoSQL Mem- HyperDex cached RDBMs Systems MongoDB - data models H-Store - consistency MySQL PNUTS Tao + low latency + data models SLIK Slide 7
Motivation + consistency H-Base Espresso RAMCloud Yesquel Spanner + scalability Megastore Traditional NoSQL Mem- HyperDex cached RDBMs Systems MongoDB - data models H-Store - consistency MySQL PNUTS Tao + low latency + data models SLIK Slide 8
Talk Outline ● Motivation ● Design ● Performance ● Related Work ● Summary SLIK Slide 9
Design ● Data model ● Scalability ● Strong consistency ● Storage ● Durability ● Availability SLIK Slide 10
Design ● Data model ● Scalability ● Strong consistency ● Storage ● Durability ● Availability SLIK Slide 11
Design ● Data model ● Scalability ● Strong consistency ● Storage ● Durability ● Availability SLIK Slide 12
Scalability ● Nearly constant low latency irrespective of the server span ● Linear increase in throughput with the server span SLIK Slide 13
Index Partitioning: Colocation ● Colocate index entries and objects ● One of the keys used to partition the objects and indexes Server 3 Server 1 Server 2 Indexlet Indexlet Indexlet index key b è 8 m è 7 a è 2 n è 3 q è 1 e è 4 g è 6 v è 5 primary Tablet key Tablet Tablet 1 q rose 4 e clover 7 m lily 2 a tulip 5 v daily 8 b dahlia 6 g iris 3 n violet primary value index key key SLIK Slide 14
Index Partitioning: Colocation ● Colocate index entries and objects ● One of the keys used to partition the objects and indexes ● No association between index partitions and index key ranges Server 3 Server 1 Server 2 Indexlet Indexlet Indexlet index key b è 8 m è 7 a è 2 n è 3 q è 1 e è 4 g è 6 v è 5 primary Tablet key Tablet Tablet 1 q rose 4 e clover 7 m lily 2 a tulip 5 v daily 8 b dahlia 6 g iris 3 n violet tablet & indexlet w/ pk 1 to 3 : S 1 primary value index Metadata: tablet & indexlet w/ pk 4 to 6 : S 2 key key Slide 15 tablet & indexlet w/ pk >= 7 : S 3
Index Partitioning: Colocation Client query: objects with index key between m - q Server 3 Server 1 Server 2 Indexlet Indexlet Indexlet b è 8 m è 7 a è 2 n è 3 q è 1 e è 4 g è 6 v è 5 Tablet Tablet Tablet 1 q rose 4 e clover 7 m lily 2 a tulip 5 v daily 8 b dahlia 6 g iris 3 n violet SLIK Slide 16
Index Partitioning: Colocation Client query: objects with index key between m - q Server 3 Server 1 Server 2 Indexlet Indexlet Indexlet b è 8 m è 7 a è 2 n è 3 q è 1 e è 4 g è 6 v è 5 Tablet Tablet Tablet 1 q rose 4 e clover 7 m lily 2 a tulip 5 v daily 8 b dahlia 6 g iris 3 n violet SLIK Slide 17
Index Partitioning: Colocation Client query: objects with index key between m - q Server 3 Server 1 Server 2 Indexlet Indexlet Indexlet b è 8 m è 7 a è 2 n è 3 q è 1 e è 4 g è 6 v è 5 Tablet Tablet Tablet 1 q rose 4 e clover 7 m lily 2 a tulip 5 v daily 8 b dahlia 6 g iris 3 n violet SLIK Slide 18
Index Partitioning: Colocation Client query: objects with index key between m - q Server 3 Server 1 Server 2 Indexlet Indexlet Indexlet b è 8 m è 7 a è 2 n è 3 q è 1 e è 4 g è 6 v è 5 Tablet Tablet Tablet 1 q rose 4 e clover 7 m lily 2 a tulip 5 v daily 8 b dahlia 6 g iris 3 n violet Not Scalable! Slide 19
Index Partitioning: Independent ● Partition each index and table independently ● Partition each index according to sort order for that index Server 4 Server 5 Indexlet Indexlet index key m è 7 n è 3 q è 1 v è 5 a è 2 b è 8 e è 4 g è 6 primary key Server 1 Server 2 Server 3 Tablet Tablet Tablet 4 e clover 1 q rose 7 m lily 5 v daily 2 a tulip 8 b dahlia 6 g iris 3 n violet SLIK Slide 20 primary index value key key
Index Partitioning: Independent ● Partition each index and table independently ● Partition each index according to sort order for that index Server 4 Server 5 Indexlet Indexlet index key Metadata: m è 7 n è 3 q è 1 v è 5 a è 2 b è 8 e è 4 g è 6 tablet w/ pk 1 to 3 : S 1 primary key tablet w/ pk 4 to 6 : S 2 tablet w/ pk >= 7 : S 3 indexlet w/ sk a to g : S 4 indexlet w/ sk >= h : S 5 Server 1 Server 2 Server 3 Tablet Tablet Tablet 4 e clover 1 q rose 7 m lily 5 v daily 2 a tulip 8 b dahlia 6 g iris 3 n violet SLIK Slide 21 primary index value key key
Index Partitioning: Independent Server 4 Server 5 Indexlet Indexlet m è 7 n è 3 q è 1 v è 5 a è 2 b è 8 e è 4 g è 6 Client query: objects with index key between m - q Server 1 Server 2 Server 3 Tablet Tablet Tablet 4 e clover 1 q rose 7 m lily 5 v daily 2 a tulip 8 b dahlia 6 g iris 3 n violet SLIK Slide 22
Index Partitioning: Independent Server 4 Server 5 Indexlet Indexlet m è 7 n è 3 q è 1 v è 5 a è 2 b è 8 e è 4 g è 6 Client query: objects with index key between m - q Server 1 Server 2 Server 3 Tablet Tablet Tablet 4 e clover 1 q rose 7 m lily 5 v daily 2 a tulip 8 b dahlia 6 g iris 3 n violet SLIK Slide 23
Index Partitioning: Independent Server 4 Server 5 Indexlet Indexlet m è 7 n è 3 q è 1 v è 5 a è 2 b è 8 e è 4 g è 6 Client query: objects with index key between m - q Server 1 Server 2 Server 3 Tablet Tablet Tablet 4 e clover 1 q rose 7 m lily 5 v daily 2 a tulip 8 b dahlia 6 g iris 3 n violet SLIK Slide 24
Index Partitioning: Independent Server 4 Server 5 Indexlet Indexlet m è 7 n è 3 q è 1 v è 5 a è 2 b è 8 e è 4 g è 6 Client query: objects with index key between m - q Server 1 Server 2 Server 3 Tablet Tablet Tablet 4 e clover 1 q rose 7 m lily 5 v daily 2 a tulip 8 b dahlia 6 g iris 3 n violet Slide 25 Scalable!
Scalability ● Nearly constant low latency irrespective of the server span ● Linear increase in throughput with the server span SLIK Slide 26
Scalability ● Nearly constant low latency irrespective of the server span ● Linear increase in throughput with the server span ● Solution: Use independent partitioning ● But: indexed object writes: distributed operations ● Potential consistency issues between indexes and objects SLIK Slide 27
Design ● Data model ● Scalability ● Strong consistency ● Storage ● Durability ● Availability SLIK Slide 28
Design ● Data model ● Scalability ● Strong consistency ● Storage ● Durability ● Availability SLIK Slide 29
Consistency Properties ● If an object contains a given secondary key, then an index lookup with that key will return the object ● If an object is returned by index lookup, then this object contains a secondary key for that index within the specified range SLIK Slide 30
Consistency Properties ● If an object contains a given secondary key, then an index lookup with that key will return the object ● If an object is returned by index lookup, then this object contains a secondary key for that index within the specified range Alice Bob Trent Frank Peggy Carol SLIK Slide 31
Consistency Properties ● If an object contains a given secondary key, then an index lookup with that key will return the object ● If an object is returned by index lookup, then this object contains a secondary key for that index within the specified range Alice Bob Alice ? students Trent Frank with name between a – d? Peggy Carol Carol SLIK Slide 32
Consistency Properties ● If an object contains a given secondary key, then an index lookup with that key will return the object ● If an object is returned by index lookup, then this object contains a secondary key for that index within the specified range SLIK Slide 33
Recommend
More recommend