Reducing Replication Bandwidth for Distributed Document Databases - - PowerPoint PPT Presentation

reducing replication bandwidth for distributed document
SMART_READER_LITE
LIVE PREVIEW

Reducing Replication Bandwidth for Distributed Document Databases - - PowerPoint PPT Presentation

Reducing Replication Bandwidth for Distributed Document Databases Lianghong Xu 1 , Andy Pavlo 1 , Sudipta Sengupta 2 Jin Li 2 , Greg Ganger 1 Carnegie Mellon University 1 , Microsoft Research 2 #1 You can sleep with grad students but not


slide-1
SLIDE 1

Reducing Replication Bandwidth for Distributed Document Databases

Lianghong Xu1, Andy Pavlo1, Sudipta Sengupta2 Jin Li2, Greg Ganger1 Carnegie Mellon University1, Microsoft Research2

slide-2
SLIDE 2
slide-3
SLIDE 3

#1 – You can sleep with grad students but not undergrads.

slide-4
SLIDE 4

#2 – Keep a bottle of water in your office in case a student breaks down crying.

slide-5
SLIDE 5

#3 – Kids love MongoDB, but they want to go work for Google.

slide-6
SLIDE 6
slide-7
SLIDE 7

Reducing Replication Bandwidth for Distributed Document Databases

In ACM Symposium on Cloud Computing,

  • pg. 1-12, August 2015.

More Info: http:/ /cmudb.io/doc-dbs

slide-8
SLIDE 8

Replication Bandwidth

Operation logs Operation logs

Primary Database Secondary MMS

WAN

slide-9
SLIDE 9

Replication Bandwidth

Operation logs Operation logs

Primary Database Secondary MMS

WAN

Goal: Reduce bandwidth for WAN geo-replication.

slide-10
SLIDE 10

Why Deduplication?

  • Why not just compr

pres ess?

– Oplog batches are small and not enough overlap.

  • Why not just use diff

iff?

– Need application guidance to identify source.

  • Dedupl

eduplicati tion finds and removes redundancies.

slide-11
SLIDE 11

Traditional Dedup

Modified Region Duplicate Region Chunk Boundary

Deduped Data Incoming Data

1 2 4 5 1 2 4 5 3

Send deduped data to replicas.

slide-12
SLIDE 12

Traditional Dedup

Modified Region Duplicate Region Chunk Boundary

Incoming Data Deduped Data

Must send the entire document.

slide-13
SLIDE 13

Similarity Dedup

Modified Region Duplicate Region Chunk Boundary

Incoming Data Deduped Data

Delta! Delta! Delta! Delta! Delta!

Only send delta encoding.

slide-14
SLIDE 14

Compress vs. Dedup

20GB sampled Wikipedia dataset. MongoDB v2.7 / / 4MB Oplog batches

slide-15
SLIDE 15

Primary Node Client Secondary Node

sDedup: Similarity Dedup

Source documents Insertion & Updates Database Oplog Delta Compressor

Unsynchronized

  • plog entries

Deduplicated

  • plog entries

Oplog

Re-constructed

  • plog entries

Replay Delta Decompressor Oplog syncer Database Source documents Source Document Cache

slide-16
SLIDE 16

Encoding Steps

  • Identify Similar Documents
  • Select the Best Match
  • Delta Compression
slide-17
SLIDE 17

Identify Similar Documents

Target Document

Consistent Sampling Similarity Sketch Rabin Chunking

32 17 25 41 12 41 32 Feature Index Table Candi ndida date Docum ument ents 41 32 32 25 38 41 12 32 17 38 41 12 39 32 22 15

Doc #1 Doc #2 Doc #3

32 25 38 41 12 32 17 38 41 12

Doc #2 Doc #3

1

Doc #1

2

Doc #2

2

Doc #3

Simila imilarit ity Score re

slide-18
SLIDE 18

Selecting the Best Match

Source Document Cache

Rank Candidates Score 1 2 1 2 2 1 Doc #1 Doc #2 Doc #3

Init itial R ial Ran ankin ing Fin inal R al Ran ankin ing

Rank Candidates Cached? Score 1 Ye Yes 6 1 Ye Yes 3 2 No 2 Doc #1 Doc #3 Doc #2

Is doc cached? If yes, reward 3x

slide-19
SLIDE 19

Delta Compression

  • Byte-level diff between source and target docs:

– Based on the xDelta algorithm – Improved speed with minimal loss of compression

  • Enc

ncoding ng: :

– Descriptors about duplicate/unique regions + unique bytes

  • Dec

Decoding ng:

– Use source doc + encoded output – Concatenate byte regions in order

slide-20
SLIDE 20

Evaluation

  • MongoDB setup (v2.7)

– 1 primary, 1 secondary node, 1 client – Node Config: 4 cores, 8GB RAM, 100GB HDD storage

  • Datasets:

– Wikipedia dump (20GB out of ~12TB) – Stack Exchange data dump (10GB out of ~100GB)

slide-21
SLIDE 21

Compression: Wikipedia

9.9 26.3 38.4 38.9 2.3 4.6 9.1 15.2 10 20 30 40 50

4KB 1KB 256B 64B Compression Ratio Chunk Size sDedup trad-dedup 20GB sampled Wikipedia dataset

slide-22
SLIDE 22

Memory: Wikipedia

34.1 47.9 57.3 61.0 80.2 133.0 272.5 780.5 200 400 600 800

4KB 1KB 256B 64B Memory (MB) Chunk Size sDedup trad-dedup 20GB sampled Wikipedia dataset

slide-23
SLIDE 23

Compression: StackExchange

1.0 1.2 1.3 1.8 1.0 1.0 1.1 1.2 1 2 3 4 5

4KB 1KB 256B 64B Compression Ratio Chunk Size sDedup trad-dedup 10GB sampled StackExchange dataset

slide-24
SLIDE 24

Throughput Overhead

slide-25
SLIDE 25

Dedup + Sharding

38.4 38.2 38.1 37.9 10 20 30 40 50

1 3 5 9 Compression Ratio # of Shards 20GB sampled Wikipedia dataset

slide-26
SLIDE 26

Failure Recovery

20GB sampled Wikipedia dataset.

Failure Point

slide-27
SLIDE 27

Conclusion

  • Similarity-based deduplication for

replicated document databases.

  • sDedup for MongoDB (v2.7)

– Much greater data reduction than traditional dedup – Up to 38x compression ratio for Wikipedia – Resource-efficient design for inline deduplication with negligible performance overhead

slide-28
SLIDE 28

What’s Next?

  • Port code to MongoDB v3.1
  • Integrating sDedup into WiredTiger

storage manager.

  • Need to test with more workloads.
  • Try not to get anyone pregnant.
slide-29
SLIDE 29

WiredTiger vs. sDedup

Compression Ratio Snappy 1.6x zLib 3.0x sDedup (no compress) 38.4x sDedup + Snappy 60.8x sDedup + zLib 114.5x

20GB sampled Wikipedia dataset.

slide-30
SLIDE 30

END

@andy_pavlo