powerpoint presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 write amplifcation for diffferent...

73

Upload: others

Post on 10-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 2: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 3: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 4: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 5: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 6: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 7: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 8: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 9: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 10: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 11: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 12: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

new

Page 13: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

new

Page 14: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

new

Block ID Reference

Block1

Block2

Block3

Page 15: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 16: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 17: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

ApplicationBuffer

Buffered I/O Page Cache

Direct I/O

StorageDevice

Page 18: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 19: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 20: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 21: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 22: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 23: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Shard 1

Shard 5

Shard 10

Shard 12

Shard 2

Shard 5

Shard 8

Shard 9

Page 24: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

MapReduce Job

Page 25: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 26: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 27: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 28: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Memtable(Skiplist)

Page 29: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 30: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 31: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

File.sst

Page 32: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

A-B

L-M

C-D E-F G-K L-M

A-B C-D E-F Y-Z

A-F B-K

C-E

X-Z

Page 33: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

A-B

L-M

C-D E-F G-M

L-MA-B C-D E-F Y-Z

A-F B-K

C-E

X-Z

Page 34: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

A-B

L-M

C-D E-F G-M

A-B C-D E-F Y-Z

A-F

M-Q

X-Z

B-K

Page 35: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

A-B C-D E-F G-M

A-B C-D E-F Y-Z

A-F

M-Q

X-Z

B-KM-Q L-ML-M

Page 36: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 37: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

MemTable(SkipList)

Page 38: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

index

Page 39: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Operations:

Put A1, Put B1, Put B2, Put B3,

Put A2, Put C1, Put A3

A1

A2

A3

B1

B2

B3

C1

Page 40: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Operations:

Put A1, Put B1, Put B2, Put B3,

Put A2, Put C1, Put A3

A1

A2

A3

B1

B2

B3

C1

Page 41: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Operations:

Put A1, Put B1, Put B2, Put B3,

Put A2, Put C1, Put A3

A1

A2

A3

B1

B2

B3

C1

Page 42: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Operations:

Put A1, Put B1, Put B2, Put B3,

Put A2, Put C1, Put A3

A1

A2

A3

B1

B2

B3

C1

Page 43: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Operations:

Put A1, Put B1, Put B2, Put B3,

Put A2, Put C1, Put A3

A1

A2

A3

B1

B2

B3

C1

Page 44: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

index index

Page 45: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

index

Prefix Hint

A

B

C

……

Page 46: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 47: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 48: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 49: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 50: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 51: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

..., Delete(1000), Delete(1001), …, Delete(1999), ...

…, Put(999), Put(1000), Put(1001), Put(1002) …, Put(1999), Put(2000), …

Page 52: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 53: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

DB::DeleteRange()

a b c d e

e

db->DeleteRange(“b”, “e”);

a

Page 54: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 55: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 56: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 57: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

new

new

new

Page 58: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

new

new

new

Key Value

ABC

BBC

BEE

Page 59: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

newnew

Key Value

ABC

BBC

BEE

Page 60: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

newnew

Key Value

ABC

BBC

BEE

Page 61: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

newnew

Key Value

ABC

BBC

BEE

Page 62: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

0 1 2 3 4 5 6 7 8 9 10

1000

25000

Write Amplifcation for Diffferent Value Sizes using db_bench

BlobDB + Rocksdb (Key+Value) StockRocksDB

Page 63: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 64: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 65: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Key Value

A A1

B B1

D D1

Key Value

C C1

D D2

F F1

Key Value

A A1

B B1

D D1

C C1

F F1

Page 66: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Key Value

A A1

B B1

D D1

Key Value

C C1

D D2

F F1

Key Value

D D1

C C1

F F1

if (key < “C”) {return true; // filter out

}return false;

Page 67: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 68: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 69: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 70: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

lua::RocksLuaCompactionFilterOptions lua_opt;

lua_opt.lua_script = your_lua_script;

rocksdb::Options options;

options.compaction_filter_factory =

std::make_shared<rocksdb::lua::RocksLuaCompactionFilterFactory>(lua_opt);

rocksdb::DB* db;

auto status = rocksdb::DB::Open(options, path_to_db, &db);

Page 71: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •

Page 72: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •
Page 73: PowerPoint Presentation · 0 1 2 3 4 5 6 7 8 9 10 1000 25000 Write Amplifcation for Diffferent Value Sizes using db_bench BlobDB + Rocksdb (Key+Value) StockRocksDB • •