Patrick Van Stee
December 14, 2012
640

# Convergent Replicated Data Types

## Patrick Van Stee

December 14, 2012

## Transcript

“-3000” } :(
6. ### Node 1 Node 2 { a: “200” } { a:

“-3000” } { a: “200”, a: “-3000” } Riak

11. ### Serious Business { SB[PVS]: 0} Serious Coding { SB[PVS]: 1}

# PVS++ { SC[PVS]: 0} { SC[PVS]: 5} # PVS += 5 { SB[PVS]: 2} # PVS++ Merge { SB[PVS]: 2, SC[PVS]: 5} { SB[PVS]: 1, SC[PVS]: 5} { SB[PVS]: 2, SC[PVS]: 5} { PVS: 7}
12. ### What about decrements? Use separate counters for positive and negative.

Take the difference for the result.
13. ### Serious Business { SB[PVS+]: 0, SB[PVS-]: 0 } Serious Coding

{ SB[PVS+]: 1, SB[PVS-]: 0 } # PVS++ { SB[PVS+]: 0, SB[PVS-]: 0 } { SB[PVS+]: 5, SB[PVS-]: 0 } # PVS += 5 { SB[PVS+]: 1, SB[PVS-]: 1 } # PVS-- Merge { PVS+: 6, PVS-: 1 } { PVS+: 6, PVS-: 0 } { PVS+: 6, PVS-: 1 } { PVS: 5 }

15. ### Serious Business { PVS: [ ] } Serious Coding {

PVS: [] } { PVS: [] } { PVS: [ ] } Merge { PVS: [ , ] } { PVS: [ , ] } { PVS: [ , , ] } { PVS: [ , , ] }
16. ### Hold on, Can we remove stuff? Use separate sets for

added and removed elements.
17. ### Serious Business { PVS+: [ ], PVS-: [] } Serious

Coding { PVS+: [], PVS-: [] } { PVS+: [], PVS-: [] } { PVS+: [ ], PVS-: [] } Merge { PVS+: [ , ], PVS-: [ ] } { PVS+: [ ], PVS-: [ ] } { PVS+: [ , ], PVS-: [] } { PVS+: [ , ], PVS-: [ ] } { PVS: [ ] }

19. ### U-Set •Append unique values to all set members •Garbage collection

becomes an issue