Systems & Research Project Prof. Manos Athanassoulis - - PowerPoint PPT Presentation

systems research project
SMART_READER_LITE
LIVE PREVIEW

Systems & Research Project Prof. Manos Athanassoulis - - PowerPoint PPT Presentation

CS 591: Data Systems Architectures Systems & Research Project Prof. Manos Athanassoulis http://manos.athanassoulis.net/classes/CS591 data systems >$200B by 2020, growing at 11.7% every year [The Forbes, 2016] complex analytics simple


slide-1
SLIDE 1

Systems & Research Project

  • Prof. Manos Athanassoulis

http://manos.athanassoulis.net/classes/CS591

CS 591: Data Systems Architectures

slide-2
SLIDE 2

data systems

2

>$200B by 2020, growing at 11.7% every year

[The Forbes, 2016]

complex analytics simple queries access data store, maintain, update

slide-3
SLIDE 3

3

*algorithms and data structures for organizing and accessing data

data systems

complex analytics simple queries access data store, maintain, update

access methods* >$200B by 2020, growing at 11.7% every year

[The Forbes, 2016]

slide-4
SLIDE 4

data systems core: storage engines main decisions

how to access data? how to store data? how to update data?

slide-5
SLIDE 5

let’s simplify: key-value storage engines

state-of-the-art design

collection of keys-value pairs query on the key, return both key and value

remember

slide-6
SLIDE 6

how general is a key value store?

can we store relational data?

yes! {<primary_key>,<rest_of_the_row>} example: { student_id, { name, login, yob, gpa } } what is the caveat?

how to index these attributes?

index: { name, { student_id } } index: { yob, { student_id1, student_id2, … } }

  • ther problems?
slide-7
SLIDE 7

how general is a key value store?

can we store relational data?

yes! {<primary_key>,<rest_of_the_row>} example: { student_id, { name, login, yob, gop } } what is the caveat?

how to index these attributes?

index: { name, { student_id } } index: { yob, { student_id1, student_id2, … } }

  • ther problems?

how to efficiently code if we do not know the structure of the “value”

slide-8
SLIDE 8

how to use a key-value store?

basic interface put(k,v) {v} = get(k) {v1, v2, …} = get(k) {v1, v2, …} = get_range(kmin, kmax) c = count(kmin, kmax) {v1, v2, …} = full_scan()

more

deletes: delete(k) updates: update(k,v) get set: {v1, v2, …} = get_set(k1, k2, …) is it different than put?

slide-9
SLIDE 9

how to build a key-value store?

if we have only put operations if we mostly have get operations

sort

and then what about full scan? range queries?

append

slide-10
SLIDE 10

can we separate keys and values?

at what price? locality? code?

slide-11
SLIDE 11

read queries

(point or range)

sort data amortize sorting cost

inserts

(or updates)

simply append avoid resorting after every update

how to bridge?

slide-12
SLIDE 12

LSM-tree Key-Value Stores

What are they really?

slide-13
SLIDE 13

memory updates buf buffer storage

level

slide-14
SLIDE 14

1 level

sort & flush runs

memory updates buf buffer storage

slide-15
SLIDE 15

1 level

sort & flush runs

memory updates buf buffer storage

sort-merge

slide-16
SLIDE 16

1 level

memory buf buffer storage exponentially increasing sizes

𝑃 𝑚𝑝𝑕 𝑂 levels

slide-17
SLIDE 17

1 level

memory storage buf buffer fence pointers lookup X

X

slide-18
SLIDE 18

1 level

memory storage buf buffer fence pointers lookup X

X

slide-19
SLIDE 19

1 level

memory storage fence pointers lookup X

X

Bloom filters buf buffer

true negative false positive true positive

slide-20
SLIDE 20

1 level

memory storage fence pointers lookup X

X

Bloom filters buf buffer

true negative false positive true positive

performance & cost trade-offs

bigger filters  fewer false positives memory space vs. read cost more merging  fewer runs read cost vs. update cost

slide-21
SLIDE 21

1 level

memory storage fence pointers lookup X

X

Bloom filters buf buffer

true negative false positive true positive

  • ther operations

range scans? deletes?

slide-22
SLIDE 22

1 level

sort & flush runs

memory updates buf buffer storage

sort-merge

remember merging? what strategies?

slide-23
SLIDE 23

Merge Policies

Leveling

read-optimized

Tiering

write-optimized

slide-24
SLIDE 24

Leveling read-optimized Tiering write-optimized

T runs per level

slide-25
SLIDE 25

Leveling read-optimized Tiering write-optimized

merge & flush

T runs per level

slide-26
SLIDE 26

Leveling read-optimized Tiering write-optimized

T runs per level merge

slide-27
SLIDE 27

Leveling read-optimized Tiering write-optimized

T runs per level merge

slide-28
SLIDE 28

flush

Leveling read-optimized Tiering write-optimized

T runs per level T times bigger

slide-29
SLIDE 29

1 level

memory storage fence pointers lookup X

X

Bloom filters buf buffer

true negative false positive true positive

Systems Project: LSM-Trees

merge policy size ratio tuning knobs

slide-30
SLIDE 30

more on LSM-Tree performance

slide-31
SLIDE 31

31

Leveling read-optimized Tiering write-optimized

𝑷 𝑼 ∙ 𝒎𝒑𝒉𝑼 𝑶 ∙ 𝒇−

Τ 𝑵 𝑶

lookup cost:

runs per level levels false positive rate

𝑷 𝒎𝒑𝒉𝑼 𝑶 ∙ 𝒇−

Τ 𝑵 𝑶

levels false positive rate

slide-32
SLIDE 32

32

Leveling read-optimized Tiering write-optimized

𝑷 𝒎𝒑𝒉𝑼 𝑶

update cost:

levels

𝑷 𝑼 ∙ 𝒎𝒑𝒉𝑼 𝑶

levels merges per level

𝑃 𝑈 ∙ 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

lookup cost:

𝑃 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

slide-33
SLIDE 33

33

Leveling read-optimized Tiering write-optimized

𝑃 𝑚𝑝𝑕𝑈 𝑂

update cost:

𝑃 𝑈 ∙ 𝑚𝑝𝑕𝑈 𝑂

for size ratio T

𝑃 𝑈 ∙ 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

lookup cost:

𝑃 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

slide-34
SLIDE 34

34

Leveling read-optimized Tiering write-optimized

𝑃 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂 = 𝑃 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓− Τ 𝑁 𝑂

lookup cost:

𝑃 𝑚𝑝𝑕𝑈 𝑂 = 𝑃 𝑚𝑝𝑕𝑈 𝑂

update cost:

for size ratio T

slide-35
SLIDE 35

35

Leveling read-optimized Tiering write-optimized

𝑃 𝑚𝑝𝑕𝑈 𝑂

update cost:

𝑃 𝑈 ∙ 𝑚𝑝𝑕𝑈 𝑂

for size ratio T

𝑃 𝑈 ∙ 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

lookup cost:

𝑃 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

slide-36
SLIDE 36

36

Leveling read-optimized Tiering write-optimized

𝑃 𝑚𝑝𝑕𝑂 𝑂 = 𝑷 𝟐

update cost:

𝑃 𝑂 ∙ 𝑚𝑝𝑕𝑂 𝑂 = 𝑷 𝑶

for size ratio T

𝑃 𝑂 runs per level 1 run per level

N

log sorted array

𝑃 𝑈 ∙ 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

lookup cost:

𝑃 𝑚𝑝𝑕𝑈 𝑂 ∙ 𝑓−

Τ 𝑁 𝑂

slide-37
SLIDE 37

37

read cost update cost Tiering Leveling log sorted array

T= T=2

T : size ratio

slide-38
SLIDE 38

Research Question on LSM-Trees

how to do range scans? how to delete? how to delete quickly? what if data items come ordered?

fence pointers Bloom filters buf buffer

how to allocate memory between buffer/Bloom filters/fence pointers? what if data items come almost ordered? study these questions and navigate LSM design space using Facebook’s RocksDB

slide-39
SLIDE 39

What “almost ordered” even mean?

Research question on sortedness

How to quantify it? Need a metric! How does the sortedness of the data affect the behavior of LSM-Trees, B-Trees, Zonemaps? similar question to: how does the order of the values in an array affect a sorting algorithm

slide-40
SLIDE 40

How to tune our system?

if we know the workload … LSM-Trees: memory (Buffer/BF/FP) – what about caching? Back to column-stores: do we need to sort? partition the data? add empty slots in the column for future inserts?

slide-41
SLIDE 41

Workload-based tuning

find Tuning, s.t. min cost(Workload, Data, Tuning) given Workload and Data what if workload information is a bit wrong? robust optimization (come and find me)

slide-42
SLIDE 42

what is an index?

sorted data 1 1 1 2 3 5 10 11 12 13 18 19 20 50 54 58 62 98 101 102

𝑞𝑝𝑡𝑢𝑗𝑢𝑗𝑝𝑜 𝑤𝑏𝑚 = 𝐷𝐸𝐺(𝑤𝑏𝑚) ∙ 𝑏𝑠𝑠𝑏𝑧_𝑡𝑗𝑨𝑓

can you learn the CDF? what is the best way to do so? how to update that?

slide-43
SLIDE 43

what to do now?

systems project form groups of 2 (speak to me in OH if you want to work on your own) research project form groups of 3-4 pick one of the subjects & read background material define the behavior you will study and address sketch approach and success metric (if LSM-related get familiar with RocksDB)

slide-44
SLIDE 44

what to do now?

systems project form groups of 2 (speak to me in OH if you want to work on your own) research project form groups of 3-4 pick one of the subjects & read background material define the behavior you will study and address sketch approach and success metric (if LSM-related get familiar with RocksDB)

come to OH fi finalize your project in in 2-3 weeks (b (by Feb 22nd

nd)

submit proposal on March 8th

th

slide-45
SLIDE 45

Systems & Research Project

  • Prof. Manos Athanassoulis

http://manos.athanassoulis.net/classes/CS591

CS 591: Data Systems Architectures