►
From YouTube: Lisbon Hack Week // RGA @ CRDT - Pedro Teixeira
Description
Originally recorded during the Lisbon Hack Week from May 21-25, 2018.
Originally recorded during the Lisbon Hack Week from May 21-25, 2018.
A
So
today,
I'm
here
to
tell
you
that
I
finished
one
of
my
tasks,
which
was
an
implementation
of
replicated
Global's
array
in
Delta
charities
and
I'll.
Explain
you
briefly
explain
you
why
that
Delta
charities
may
be
interesting
or
better
than
the
other
charities?
Okay.
So
let's
take
an
example.
There
are
two
basic
types
of
charities,
so
they
are
state-based
and
operation
based,
okay,
so
the
state-based
ones
work
by
replicating
the
states
in
forming
broadcasting
or
gossiping
about
their
own
state
and
incorporating
other
peer
States
into
joining
other
peer
States
into
their
states.
A
So,
let's
quite
quick
example
with
the
growing
with
sets
like
a
grown
Lea,
sorry
growing
the
counter.
This
is
wrong.
Let's
say
that
we
have
like
three
nodes.
We
have
the
first
one
incremented
already
to
three
and
then
this
toy
to
three
then
a
second
one
to
two
and
the
third
one
to
one.
So
three,
plus
one
plus
two
equals
six:
let's
see
how
they
propagate
oops
low
play.
Could
you
please
play
doesn't
play?
Okay,
oh
okay,
so
first
one
propagates
here
joins.
A
So
it's
due
to
one
propagates
to
the
above
due
to
one
my
point,
wise
maximum
is
three
to
one.
Then
this
one
propagates
here
T
to
one
point
wise
maximum
is
three
to
one
and
now
yeah
back
here,
three,
two
one
and
sync,
but
it's
the
same,
so
it
sings.
So
it's
six
okay!
So
now
now
the
whole
state
is
think
it's
all
converged.
This
is
this:
is
state
based
charities.
A
This
is
a
very
simple
example
of
state
based
charities.
The
problem
we
set
by
charities
is
that
the
state
tends
to
be
very
big
for
more
complex
realities.
Okay,
so
a
solution
to
that
is
to
have
operation
by
charities.
They
form
a
sequence
of
operations
locally.
Okay,
so
let's
say
we
have
a
nodes
called
a
and
already
has
two
operations,
a
1
and
a
2,
and
so
this
operation
depends
on
this
causally.
A
So
the
local
causality
is
is
pointed
by
the
arrow
and
now
there's
a
node
B
that
knows
about
these
operations
but
appends
a
new
operation
on
the
head
of
the
operation
log,
and
then
he
appends
a
new
operation
again
and
then
operation,
then
no,
they
appends
another
operation,
but
meanwhile
it
only
knew
about
this
operation.
It
doesn't
know
about
this
operation,
yet
ok,
so
they
haven't
talked
to
each
other
about
this.
This
one
only
this
one,
so
he
appends
on
to
this
one,
ok,
and
so
now
we
have
like
no.
A
They
opposed
this
one
and
node
B
depends
to
this
one,
so
they
don't
know
about
each
other.
Yet
at
this
point
fully,
so
they
are
commutative.
Okay,
so
you
have
to
store
so
we
never
know
when
you
have
when
you
have
commutative
operations,
so
you
have
their
solutions
to
this
I
learned
recently,
but
in
principle
you
have
to
store
all
the
operations,
because
you
have
may
have
these
operations
in
the
future
of
this
one
right.
A
We
have
to
store
this
one
because
you
may
have
operations
in
the
future
of
this
one,
and
the
same
goes
for
all
the
operations,
then
on
the
backlog.
Okay,
so
there
is
one
more
or
less
compact
solution
to
this,
which
is
to
infer
causal
stability
on
an
operation
which
means
that
if
an
operation
is
causing
with
stable
means
that
there
will
be
no
concurrent
operations
to
this
one,
okay,
so
in
the
future
of
this
one,
okay,
that's
so
far,
one
that
so
it
it
there's
a
way
to
infer
that
by
using
vertical
ox.
A
When
you
hear
the
state
of
audio
operations,
with
the
assumption
that
you
know
all
the
members,
that's
the
assumption,
but
I
think
there
are
also
ways
around
having
dynamic
membership.
Okay.
But
this
is
not
what
I'm
going
so
then
we
have
another
type
of
charities
which
are
based
on
the
state-based
ones,
but
our
deltas
and
on
Delta
based
charities.
The
replicates
communicate
via
Delta's,
not
by
the
entire
states.
So
a
doctor
is
not
exactly
an
operation
so
that
an
intuition
is
that
the
Delta
should
be
a
fraction
of
the
states.
A
Okay
and
a
Delta
is
idempotent
when
apply
to
the
States.
An
operation
is
not
that
important.
So
if
your
party
same
operation
two
times
it's
it,
it
yields
different
states.
Okay,
so,
but
applying
a
Delta
two
times
to
the
same
state
should
yield
the
same.
The
same
state
so
joining
s
1
and
Delta
1
you
of
ss2
joining,
is
2
Delta,
1,
again
still
yields
as
2,
so
the
advantages
that
Delta's
can
be
joined
together.
Ok,
so
they're
easy
to
bar,
for
you
can
buffer
a
bunch
of
Delta's
compressed
into
by
joining
them.
A
You
compress
them
and
then
you
can
send
them.
You
don't
have
to
buffer
all
the
up.
As
you
do
in
the
operation
by
charities,
you
don't
have
to
buffer
all
of
them.
You
can
join
them,
so
they
are
so
they
are
associative.
Also,
so
doctor
based
charity
is
defined
by
state
set
initial
set
instead
of
mutator
functions,
have
Delta
mutator
functions
that
return
deltas
and
you
have
a
joint
function
which
also
the
state-based
charities
have
and
something
that
returns
the
value.
The
view
of
the
charity
so.
A
So
an
example
based
on
on
the
previous
grow.
Only
counter
is
that
so
state
set
is
the
vector
of
integers,
greater
or
equal
to
0
she'll
set.
Is
this
vector
clock
and
the
Delta
mutator
function
is
just
an
increment
on
my
on
my
if
I'm,
if
I'm
not
note,
zero
I
only
send
the
value
of
this
one.
Okay,
so
I
don't
have
to
set
the
whole
state,
as
I
was
sending
before
I
just
send
an
update
to
my
state.
A
So
the
join
is
very
similar.
It's
the
same,
join
as
a
state
by
security,
okay.
So
it's
the
point
wise
maximum
of
the
both
states
and
that's
it,
and
so
all
this
to
tell
that
I
finished
the
first
JavaScript
implementation
of
a
replicated
growable
array
that
and
the
nice
thing
about
a
replicated
global
array
is
that
it
maintains
user
intention.
So
when
there
is
conflict,
let's
say
the
user
inputs
I
will
increase
this.
These
are
the
tests,
let's
say
that
user.
A
It
both
of
them
could
converge
to
a
b
c
d
and
b
c
d
on
both
of
them.
One
of
the
results
could
be
one
of
development.
Results
would
could
be
a
c
b
d
right,
but
that
doesn't
preserve
the
intention
of
of
both
users,
because
if
I
write
I
write
ours
here
at
Bob,
I
want
to
convert
the
result
to
be
Alice,
Bob
or
Bob
Alice,
and
not
an
interleaving
of
the
characters.
A
A
It's
not
documented
yet
so
here's
a
with
me,
okay,
the
test
could
be
something
like
so
I
think
you
saw
well
so
yeah,
so
you
can
push
insert
that
remove
at
all
the
array
etc
way
things.
This
is
just
the
RGA.
There
are
other
charity
types
that
like
set
like
types
or
map
like
types
or
array
like
types.
This
is
an
array
like
type
of
sequence
and
then
you
have
to
so
remove
by
push,
and
then
you
get
the
value
which
computes
the
view.
So
the
array
does
that
answer.
Your
question.