►
Description
Get your espresso ready for the OpenShift Coffee Break as we talk about how to deal with transactions when using microservices! Our special guest is Alex Soto Bueno, Developer Advocate at Red Hat, and he will walk us through patterns and real world examples with live demos.
Twitch: https://red.ht/twitch
A
A
A
To
our
guest
good
morning
alex
do
you
like
to
to
introduce
yourself
and
before
you
your
introduction?
Please
have
your
coffee
today,
as
always.
B
C
Yeah
well,
my
name
is
alex
otto
and
I
work
in
here.
In
fact,
I
work
in
the
same
team
as
natalie
and
and
yeah
I'm,
and
I
I
really
like
to
just
you
know
all
the
java
world,
the
kubernetes
wall,
the
kubernetes
ecosystem,
like
east
york,
native
tectonic,
ocd,
and
so
on.
It's
something
that
these
days,
I
I'm
working
pretty
much
and
yeah,
of
course,
also
java,
and
to
these
days,
especially
quarkos,.
A
Okay,
cool:
I
know
that
you
are
going
to
talk
about
distributed
deployment
over
microservices
and
dealing
also
with
dealing
with
transaction
in
the
microservices
world.
So
if
you
would
like
to
give
us
some
some
insight,
what
does
it
mean
really
having
from
dealing
with
transaction
in
a
micro
services,
world
and
microservice
architecture?.
C
B
We
have
to
do
in
the
our
backstage,
but
we
didn't
because
we
were
talking
about
tran
distributed
transactions,
so
we
were
anticipating
our
coffee
break.
B
B
No,
we
need,
we
definitely
need
you.
So
what
about?
I
think
it's
a
permission
on
kind
of
a
browser,
mac,
stuff,
yeah.
A
Alex
tried
to
figure
out,
I
think
that
we
can
remind
to
our
guests.
Please
use
our
developer
sandbox,
let's
give
in
the
chat
the
link
to
try,
play
and
enjoy
our
developer
sandbox.
Let's
remind
our
what
is
natalie.
A
The
developer
said
redacted
developers
and
why
our
our
guest
developer
guest
should
subscribe
to
developer
sandbox.
B
Right
fabio,
so,
in
fact,
alex
is
gonna.
Do
a
demo
on
developer
sandbox,
which
is
an
environment
free
to
use
a
kind
of
a
cloud
kubernetes
environment
where
you
have
a
multi-tenant
access
to
an
open
shift
cluster
and
there
you
can
start
deploying
your
application.
You
can
start
trying
out
to
even
databases.
B
We
have
a
new
offering
called
roda
that
lets.
You
link
databases
as
a
service.
There
are
a
component
there's
a
component
called
the
sys
service
binding
that
I
think
alex
is
going
to
use.
Also,
that
can
be,
can
be
used
to
link
databases
or
or
or
or
queue
system,
or
even
kafka
streams.
Kafka
data
streams
about
kafka
fabio
there's
also
and
managed
kafka
in
offering
in
sas.
B
Basically,
you
can
try
to
use
kafka
in
your
applications
and
you
can
attach
your
kafka
workloads
in
into
that
from
the
topology
view.
So
I
put
the
link
in
the
chat
to
the
sandbox
it's
free
to
use.
If
you
want
to
register
it's
free
to
use,
you
have
this
free
account
on
openshift
and
yeah.
I
think
we
have
also
suggested
from
the
chat
thanks
sebby
for
technical
suggestions.
A
B
A
A
Sebastian
provides
some
the
right
suggestion,
but
I
so
it.
B
B
Fabio:
let's
take
this
opportunity
to
also
talk
about
our
rich
shadow.
We
have
in
april
upcoming
schedule
on
openshift
tv
because
we
have
something
very
cool
coming
up.
I
think
there's
also
andrea,
that
invited
one
of
our
colleagues
to
talk
about
more
keep
talking
about
camel,
camel
k,
and
we
have
all
also
other
colleagues
joining
again
talking
about
how.
A
Is
part
of
it's
a
it's?
A
third-party
companies
that
certify
the
solution
on
opposition
should
be
really
oh,
alex.
A
C
Yeah
then
yeah
today
we're
going
to
talk
about
transactions
in
the
microservices
world
and
yeah
the
slides
are
open.
So
you
can
you
can
check
the
link
yeah,
they
will
share
with
you
and
you
can
access
them
yeah.
You
can
reuse
it.
They
are
public,
so
yeah,
my
name
is
alex
otto
and
my
tutor
is
alex
sotoby,
I'm
director
of
the
local
experience
of
red
hat
and
well.
C
Basically,
I'm
the
author
of
testing
java
microservices
quarkus
cookbook,
securing
community
secrets,
and
these
days
I'm
writing
github's
cookbook
with
someone
that
it's
also
in
the
call
today
so
which
is
natalie
and
we're.
We
are
co-writing
this
book
together
here
we.
A
C
If
you
have
any
question-
and
you
want
to
ask
me
on
twitter,
then
you
can
also
come
follow
me
and
we
need
to
think
that
maybe
like
yeah,
maybe
six
seven
eight
years
ago,
our
applications
were
like
something
like
this
in
the
lab:
the
old
school
architecture,
where
we've
got
all
monolith
application
with
you
know
all
the
code
inside
and
then
we've
got
the
database
there
and
all
the
operations
were
done
against
this
specific
database
and
everything
was
in
the
same
context.
C
But
let's
say
that
this,
like
eight
six
years
ago,
we
decided
that
it
could
be
a
good
idea
to
breaking
down
this
monolith
into
a
services,
architecture
or
well
yeah.
You
know
that
some
people
say
microservices
are
true
and
well.
In
this
case,
we've
got
several
services,
all
of
them
interconnected,
and
one
of
the
key
points
is
that
each
of
these
microservices
has
its
own
database.
C
Okay,
there
is
one
approach.
This
is
named,
two
face
comments
or
two
pc
that,
as
the
name
suggests,
there
are
two
phases
when
we
are
starting
a
transaction
one.
It's
the
prepared
phase,
another
one
is
the
commit
phase
and
it
works,
and
it
works
like
this.
We've
got
first
of
all,
several
services
in
this
case,
I
just
put
it
too,
to
simplify
the
use
case.
C
Gets
a
request
and
it
needs
to
insert
something
into
that
array.
It
says:
okay,
I'm
going
to
insert
this
into
the
database
and
I'm
going
to
send
a
message
to
a
coordinator.
So
there
is
another
piece
of
software
out
there.
That's
named
coordinator
that
receives
something
from
the
service,
a
saying:
hey,
I've
inserted
something
into
my
database,
but
I
cannot
commit
the
transaction
yet
because
I
know
that
there
is
other
operations
there
and
of
course,
then
there
is
the
service
v
that
says.
C
C
It
just
communicates
to
each
of
the
services
saying:
okay,
everything
work
as
expected,
all
your
services
work
correctly,
so
just
commit
your
results
or
if
we've
got,
for
example,
this
service
work
correctly,
and
this
throws
an
error.
Maybe
a
I
don't
know
for
inhibition,
then
the
coordinator
will
say:
okay
in
this
macro
transaction,
there
was
one
service
that
failed.
It
means
that
all
of
you
need
to
do
a
rollback.
C
This
is
a
two-phase
strategy
and
it
works
but
notice
that
you
are
sending
four
messages
for
each
micro
service
right.
You
are
you
see
here,
I'm
sending
this
message,
then
the
recording
to
send
me
another
one
and
here
coordinator,
sending
me
a
message
and
I'm
getting
okay,
it's
it's
work
or
not,
so
I'm
sending
four
messages
for
each
micro
service.
So
if
you've
got
like
100
micro
services,
okay,
there's
a
lot
of
messages.
C
This
also
makes
things
work
really
slow.
Keep
in
mind
that
you
cannot
commit,
or
you
cannot
drawback
anything
until
all
the
microservices
involved
in
that
transaction
finishes.
So
maybe
it's
10.
Maybe
it's
20!
Maybe
it's
two
services,
so
you
see
that
at
the
end
you
need
to
wait
as
much
time
as
the
slowest
microservice.
C
C
So,
let's
introduce
an
example
and
see
another
way
of
doing
this,
and
in
this
case
I
just
prepared
a
simple
example,
but
it
will
help
us
to
visualize
everything
and
it's
a
cinema
booking
seat,
a
system
where
you,
you
know
you
have
the
cinema
and
then
you
can
choose
a
seat
and
you
make
the
reservation
of
the
seat.
Then
you
just
do
a
checkout,
so
you
pay
the
seat.
You
then
disa
payment
gateway
service
just
connects
to
a
bank.
You
know
it
makes
all
the
transactions.
C
C
Okay,
it's
it's
a
really
simple
service
architecture
with
two
services,
one
of
the
cinema
bookings
seat,
another
one
with
the
payment
gateway.
C
This
is
from
the
point
of
view
if
you
want,
like
the
front
end
plus,
what's
happening
in
the
back
end.
You
see
that
here
you
have
the
cinema
the
front
and
it's
coming
from
an
example
from
lra.
You
will
see
it
in
a
few
moments
and
you've
got
the
cinema
and
you
select
the
the
seed.
Maybe
in
this
case
I
selected
the
scene
number
34
and
then
I
want
to
reserve
this.
C
Then,
when
I
push
this
button,
what's
happening,
is
that
I'm
just
sending
and
http
post
request
to
slash
booking
slash
create
so
I'm
just
creating
a
booking
and
apart
from
a
lot
of
things,
I'm
just
reserving
this
seat
inside
the
database.
So
I'm
just
saying
the
seat.
Number
34
for
this
room
has
been
reserved.
C
Then,
when
I,
when
I
just
after
I
finish
this,
I'm
presented
with
this
screen
saying:
okay,
now
it's
time
to
pay
and
to
pay
you
you
just
he
put
it
amount
and
so
on
you
put
pay
and
when
I
push
pay,
I'm
going
to
the
cinema
booking
sheet
service,
I
do
a
request
to
slash
payment,
slash
pay
that
at
the
same
time
we'll
do
a
check
out
to
the
payment
gateway
so
in
slash,
pay
and
yeah,
and
then
finally,
we'll
send
the
payment
to
the
bank.
C
So
you
can
see
that
here
there
are
things
that
might
go
wrong.
That
might
fail,
for
example,
it
might
fail
when
I'm
inserting
my
reservation
in
the
seed
reservation
database.
That's
one
thing
but
suppose
that
this
thing
works,
but
it
fails.
While
I'm
doing
the
same
payment
to
my
bank,
maybe
my
bank
is
down
so
now.
I
got
it
a
failure.
C
So
this
use
case
is
something
that,
with
a
distributed
transactions
with
the
two
phase,
commit
approach
might
not
work,
because
in
this
case
there
is
no
database
involved.
C
C
Where
there
is
no
database
involved,
so
saga
pattern,
it
can
be
known
as
a
long
life
transactions,
because
it's
just
a
sequence
of
interleaved
transactions.
You
can
think
like
it's
like
a
macro
transaction,
that
inside
it
has
some
sub
transactions,
and
one
of
the
things
of
all
these
macro
of
these
sub
transactions
is
that
all
of
them
needs
to
finish,
or
we
need
to
apply
some
compensations
right.
So
it's
like
okay,
the
transaction
has
failed.
C
B
C
C
C
I
know
that
now
maybe
it's
like
it's
super
hard
to
understand,
but
I've
got
in
a
slide
that
it
summarizes
everything.
Keep
in
mind
that
all
these
compensations
needs
to
be
important,
because
you
could
want
to
execute
these
compensations
more
than
one
and
you
are
just
changing
the
atomicity
part
of
a
transaction
for
availability.
C
C
C
This
is
a
successful
scenario.
I
said:
okay,
I'm
starting
a
saga,
so
I'm
starting
this
big
transaction
and
then
I
start
the
star
reservation
city
one.
Then
I
end
the
reservation
city
one.
Then
I
start
the
payment
t2.
I
end
the
payment
of
t2
and
finally
ends
the
saga.
So
if
everything
works,
it's
fine,
nothing
happens.
You've
got
here
your
receipt
for
being
paid
for
the
seat
and
you
got
your
tickets.
That's
fine!
C
C
So
remember
that
when
I
show
you
the
ui,
you
see
that
it
was
like
two
like
like
a
wizard
right
at
first,
you
select
the
seat.
You
do
that.
You
want
to
reserve,
you
reserve
it.
Then
you
get
it
the
payment,
you
pay.
So
it's
like
two
different
sub
transactions
into
this
macro
transaction
and
what's
happening.
If
the
start
payment
of
t2
fails,
then
what
we
will
need
to
do
is
start.
C
Compensating
the
payment
c2
and
the
compensator
payment
c2
and
execute
all
the
previous
compensation
logic
in
this
case
compensate
the
c1
compensate
c1,
okay,
so
you're,
just
if
you
will
drawing
back
your
business
logic
to
the
state
before
we
started
the
saga.
In
this
case
it
means
unreserving
the
seed
and,
if
you
have
already
paid
to
to,
if
the
user
has
already
paid,
then
get
back
the
money.
C
And
there
is
another
piece
out
here
in
the
saga
pattern,
which
is
that
saga
execution
coordinator
because,
as
it
happens
with
the
two-phase,
commit
approach,
you
need
a
coordinator,
you
need
someone
who
can
coordinate
all
this
execution
and
also
apart
from
coordinating
it,
just
stores
the
logs
of
what's
happening
in
terms
of
transactions.
So
if
there
is
a
failure
in
the
psych
execution
coordinator,
you
can
always
recover
to
a
known
state.
C
C
C
The
checkout
gets
that
a
payment
gateway
t2,
which
is
the
transaction
two.
Then
it
finished
so
it
ends
the
saga
one
and
finally,
the
second
generation
coordinator
sends
a
request
to
the
bot
services
saying
that
the
saga
one
has
been
completed,
and
you
can
see
here
that
I'm
saying
that
the
whole
transaction,
the
whole
macro
transaction.
It's
named
saga,
one
what's
happening
if
there
is
a
failure.
Well,
if
there
is
a
failure,
it
happens
exactly
the
same.
So
it
starts
the
cycle.
One
then
it
does
it
does
the
transaction
one
it
does.
C
The
transaction
two
ends
the
saga,
but
notice
that
there
is
a
failure
during
the
transaction
too.
So
what
it
does.
The
site
execution
coordinator
is
sending
to
the
services
that
they
need
to
execute
the
compensation
logic,
this
one,
the
c2
and
this
one,
the
c1
how
to
implement
this
in
java,
okay,
there
is
a
there's
different
ways
to
do
that,
but
I
recommend
you
using
the
micro
profile
lra
specification.
You
see
this
is
a
microprofile
spec.
C
This
is
the
microprofile
3.0
and
I
think
that
now
it's
like
four
and
here
there
is-
there
are
some,
let's
say
some
specifications
that
are
under
the
umbrella
of
microprofile,
which
is
the
reactive
streams,
operators,
graphql,
concurrency
tools
and
error.
A
and
lra
is
for
long
running
actions
and
it
implements
this
saga
pattern.
C
So
you
can
easily
take
a
java
application
to
follow
this
and,
let's
say
we're
implementing
this
pattern,
and
here
is
the
example:
we're
going
to
see
today
using
a
microprofile
error,
a
specification,
and
you
only
need
to
annotate
the
methods
with
an
array,
so
here
see
that
it
says
this
method
create
a
booking.
It's
a
you
know,
it's
a
jax
address,
service
method
or
endpoint
create.
As
I
said
before,
and
I
initiate
with
lra.
I'm
saying
this
needs
a
new
macro
transaction.
C
It
needs
a
really
big
transaction
and
see
that
I'm
saying
that
this-
a
big
transaction-
it's
not
finishing
when
this
when
this
method
has
stopped
running
its
its
business
logic.
So
it's
like
hey.
Although
this
method
finishes,
the
macro
transactions
is
still
alive
because
remember
that
we
said
that
a
macro
transaction
is
a
is
composed
by
sub-transactions.
C
So
I'm
saying
that
this
is
a
sub-transaction
and
it's
not
the
end
of
the
saga.
So
it
starts
the
saga
but
doesn't
end
the
saga
and
then
also
I
just
created
another
endpoint
with
compensate
annotation,
and
this
compensator
notation
is
just
to
say
when
there
is
an
error
on
any
of
the
following
transactions
or
sub-transactions,
then
to
recover
to
compensate
what
I've
done
in
the
create
booking
method
I
just
create.
You
just
need
to
call
me
this
thing
and
this
endpoint,
the
slash
compensate,
is
going
to
be
automatically
called
by
the
saga
executor
coordinator.
C
So
it's
not
something
that
you
need
to
call
by
your
own.
It's
something
that
it's
automatically
called
by
the
cyber
executor
coordinator.
You
see
here
that
I
say
that
the
sec
one
is
calling
me
with
the
compensation
endpoint.
So
for
the
reason
you
want
to
do
it
here
in
this
way,
and
then
here
I've
got
the
payment
gateway
and
when
I've
done
the
payment,
it
means
that
I
finish
the
I
finish
the
transaction,
so
I'm
just
saying
that
I
want
to.
I
want
to
be
inside
a
macro
transaction.
C
For
this
reason
I
put
it
here
mandatory,
so
it
means
that
I
need
to
be
inside
a
transaction,
and
I
put
it
here
end
true.
It
means
that
this
is
when
I
finish
executing
this
method,
then
this
saga
has
finished.
This
macro
transaction
has
been
finished
and
you
can
see
that
even
I
can
just
get
the
macro
transaction
id
because
it's
always
set
in
the
header
parameter.
C
So
if
you
want
to
learn
more
about
microprofile
lra,
this
is
the
link
here.
You
see
all
the
specifications
because
it
does
a
lot
of
more
things
and,
of
course,
now
we're
going
to
see
a
demo,
and
this
is
the
link
of
the
demo
that
you
can
deploy
on
your
own
without
no
problem.
Because
and
that's
the
point
it's
going
to
be
deployed
in
the
red
retro
developer
sandbox.
B
Not
yet
there
was
a
comment.
Sorry
there
was
a
comment
from
pradeep
saying
that
in
the
school
we
we
in
a
new
school
we
have
new.
We
have
many
databases,
will
it
go?
Will
it
cost
us?
So
the
question
is:
what
is
the
cost
of
having
multiple
databases
instead
of
having
one
single
database
for
one
single
application.
C
Yeah
yeah,
I
would
say
that
I
would
say
that,
first
of
all,
of
course,
the
cost
of
that
you
need
to
maintain
them,
that's
one
cost,
so
it
means
that
you
need
to
keep
them
running,
updating
and
so
on.
That's
one
cause.
Another
cost.
B
C
C
The
consistency
between
databases,
you
know
that
with
microservices
we
end
up
with
this
thing.
That's
named
eventual
consistency,
so
with
one
database
you
can
do
join
between
tables,
but
with
multiple
databases.
You
cannot
join
the
data
inside
these
databases,
so
you
need
to
do
this
kind
of
joints
doing
calls
between
services.
So
it's
also
a
cost.
I
don't
know
if
this
answer
the
question
and
maybe
you've
got
another
other
points,
but.
A
Probably
yeah,
that's
part
of
let's
say
of
the
game,
to
have
a
different
database
instances,
instead
of
just
the
big
ones.
At
the
same
time,
correct
me
if
I'm
wrong,
when
you
have
to
change
something
in
just
a
business
domain,
the
application,
the
impact
in
terms
of
data
model
will
be
only
that
domain
instead
of
change
and
also
in
terms
of
unit
tests
and
side
effects.
A
Instead,
if
you
have
a
big
database,
the
impact
to
change
all
the
data
model,
it
is
a
bigger
one,
so
there
is
always
a
balance
between,
let's
say,
computational
cost
and,
and
we
should
also
calculate
what
does
it
mean
to
have
a
big
database
running
the
cloud
or
running
also
just
bare
metal
instead
of
having
just
smaller
databases?
And
so
I
think,
probably
that
there
is
no
just
one
answer,
but
it's
just
case
by
case
and
let's
see.
C
Yeah
also
there's
another
big
advantage.
Is
that
that
you
can?
I
mean
your
throw
put,
especially
on
writing.
C
Records
are
faster
with
multiple
databases
that
with
just
one
database,
it's
like
kaka
and
partitions
that,
since
you've
got
multiple
partitions,
you
can
write
pretty
fast,
because
each
of
this
partition
can
be
deployed
in
different
machines.
Then
more
or
less.
You
can
think
sort
of
the
same
approach
that
if
you've
got
multiple
microservices
and
each
one
each
of
these
microsoft
with
its
own
database.
It
means
that
you
can
write,
let's
say,
request
in
parallel,
because
the
microservice
a
is
going
to
write
to
the
database.
C
C
Okay,
then,
let's,
let's
see,
let's
see
the
the
demo
of
that
I've
prepared
it's
exactly
this,
this
cinema
approach.
Okay,
I've
got
here
red
hat
of
sandbox.
You
can
just
you
know,
open
the
create
your
account
and
then
clone
the
repo
that
it
was
shared,
which
is,
I
think,
that
insured
here,
which
is
this
one.
C
Well,
it's
this
one
yeah
here.
Let
me
see
if
I
can
copy
it's
this
one.
Okay
here
is
the
source
code.
You
can
see
the
source
code,
the
payment
and
the
sheet
booking
everything
it's
implemented
in
in
quarkus,
but
at
the
end,
quercus
is
just
using
the
microprofile
lra
specification,
so
it
should
work
in
any
other
java
java
project.
Now,
first
of
all,
let's
deploy
the
coordinator.
Remember
that
I
said
that
we
need
a
coordinator
to
coordinate
all
the
all
the
sagas
and
in
this
case
I'm
just
deploying
one
of
the
coordinators
that
is
narayana.
C
It's
provided
by
the
gi
boss
team
and
it's
implemented
in
quercus,
okay.
So
it's
a
it's
alright
coordinator.
There
are
others,
but
I
would
say
that
this
is
the
most
popular
one.
If
I'm
going
here,
you
see
that
it's
been
started
and
if
we
check
the
logs
okay,
you
see
that
it's
just
a
quartus
application.
That's
an
important
thing!
It's
just
this
now.
C
C
Okay,
here
you
can
just
use
crunchy
or
mariadb,
but
in
this
case
I'm
going
to
select
a
mongodb.
I
just
instantiate
template
I
the
mongodb
service
name.
I
think
it's
mongodb.
Let
me
check
it.
It's
just
one
moment
to
see
wait
here.
This
is
the
application.
Now
we're
going
to
get
with
the
code
as
well.
C
C
C
Starting
okay,
it
just
takes
a
bit
of
time
because
you
need
to
you
know,
downloaded
the
image
and
about
the
container
and
starting
the
image
and
so
on.
Okay,
now
I've
got
my
mongodb
up
and
running.
I've
got
my
lra
coordinator
up
running
then,
let's
deploy
the
booking
sheet
system,
which
is
here
I
can
do
source
menu,
even
it
is,
and
keep
coral
apply.
Minus
f
kubernetes.gml
file.
If
you
are
curious
about
this
file,
it's
just
simple.
C
You
see
here
that
it's
just
a
simple
yaml
file
that
has
a
service,
and
then
I've
got
the
deployment
and
this
deployment
well.
Here
it
has
the
container
image.
That's.
C
And
you
can
run
it
here,
then
you
see
that
you've
got
the
coordinator
record
coordinator
booking
that
calls
the
payment.
I
have
the
mongodb
okay,
I
got
everything
that
last
thing
I
need
to
do
before
running.
The
demo
is
create
a
route
create
a
route
to
access
to
this
seed
booking
service.
So
I'm
going
to
administration
administrator
tab
going
to
networking
routes,
create
a
new
route
and
put
it
here,
for
example,.
C
And
select
the
service,
which
is
the
see
booking
port
8080,
create,
and
here
we
go
here-
I've
got
the
quartus
synonymous
reservation
system.
Now,
let's
go
with
the
let's
say
the
successful
or
the
green
path.
Then
I'll
show
you
the
code
and
then
let's
simulate
a
failure,
so
I'm
going
to
the,
for
example,
to
the
21,
see
that
it
says
receive
c21.
I
said
yes
now
I've
got
the
payment
yeah
I
need
to
pay.
Then
when
I
push
this
pay,
I
will
connect
to
the
payment
gateway
and
yeah.
It
says
that
it
has
been
paid.
C
Okay.
Now,
let's
see
the
code,
I've
got
here
the
sheet
booking
system.
I've
got
the
booking
resource.
As
I
said
before,
I've
got
here
the
error
rate
that
requires
a
new
macro
macro
transaction
in
the
path
slash
create
well.
In
fact,
this
is
slash,
booking
slash,
create
and
I'm
just
saying
that
okay,
I
want.
I
need
to
select
an
id,
and
this
id
is
that
saga
id.
C
Then
I'm
just
starting
the
transaction.
I
persist
it
and
finally,
if
it
works,
then
it
says
that
okay,
it
has
been
created.
If
not,
then
I
just
returned
an
error
saying
it's
already
booked.
If
there
is
a
any
kind
of
exception,
I
just
put
it
in
there
I
put
a
dot
print
stack,
trace,
yeah,
it's
something
that
you
should
not
do,
but
for
the
sake
of
simplicity,
it's
you
know
it's
it's
easier,
then
I
can
go
here
and
in.
C
Let
me
go
back
to
the
developer
tool,
because
developer
tool
is
something
super
cool
right,
because
as
a
developer,
you
need
to
take
care
of
a
lot
of
things.
And
if
you
go
to
big
lots,
you
see
that
it
says
payment
success
and
wait
payment,
success,
payment
service
response,
blah
blah
blah
okay;
here
it
is
the
cluster
of
mongodb.
It's
opened
it,
and
here
this
is
the
starting
transaction.
C
This
is
the
transaction
that
it's
been
started
or
it's
been
notified
to
the
lra
coordinator,
see
that
it
says
starting
transaction
error
rate
coordinator
8080,
and
this
is
the
id
of
the
saga.
This
is
the
idea
of
the
macro
transaction.
Then
I've
got
here
the
creating
booking
for
21
and
then
finally,
it
says:
okay
transaction
complete
for
this
service.
C
It's
not
committed
okay,
but
it
says
that
I'm
sorry
yeah
it's
committed,
because
you
know
I
paid
since
I
paid
it
says
that
the
transaction
has
been
completed
and
it
says
payment,
success,
payment,
service
response,
blah
blah
blah,
because
this
was
the
green
pad.
So
I
just
first
of
all
I
booked
the
seat.
C
Then
I
paid
and
when
I
paid
the
transaction
finished
as
it
says
here,
if
you
want,
if
we
want
to
see
the
logs,
we
can
repeat
it
with
the
22.
Now
I'm
just
going
to
do
the
research
research
see
it
and
you
see
that
it
says
creating
booking
for
22
starting
transaction,
but
there
is
no
transaction
complete
because
I'm
not
paid.
Now
when
I
paid
now,
I
got
it
that
the
transaction
complete
now
wait
here,
transaction
completed.
C
Okay,
then,
what's
happened
when
I,
when
I
want
when
I
want
to
pay
when
I
want
to
pay
I'm
just
getting
to
the
payment
resource,
which
is
in
the
slash
payment,
slash
pay
again,
I'm
saying
that
this
payment
request
should
be
inside
a
macro
transaction
that
is
identified
by
this
lra
http
context,
header,
and
it
basically
pays
if
it
works.
It
says
that
payment
service
responds,
if
not,
it
just
says,
error.
C
Okay,
now
the
payment
service.
Well,
it's
super
stupid
service.
There
it
is,
we
just
say
I'm
going
to
pay.
I
just
sleep
like
one
second
to
simulate
the
transaction
time
and
finally
notice
that
I've
got
this
boolean
and
in
this
boolean
I'm
saying
if
it's
true
then
return
an
error,
so
we
simulate
a
failure,
if
not
just
written
okay,
in
this
case
by
default,
it's
true
now,
let's
change
it.
Let's
go
here,
I'm
going
to
topology
and
close
this
I'm
going
to
pay
man
to
the
spot
terminal.
This
is
something
that
you
know.
C
C
C
Okay
now
it
says
that
misbehaving
so
now,
every
time
that
I
do
a
request
to
the
payment
service,
then
we
will
get
an
error.
Let's
go
here
again,
I
can
go
to
the
online
cinema
or
wait.
I
can.
I
can
even
do
another
thing
that
it
would
be
interesting.
C
C
Okay,
perfect,
so,
let's
see
you
see
that
there
are
two
seats:
the
21
and
the
22
right
now,
I'm
remember
that
we
said
that
payment
is
going
to
fail.
I'm
going
to
take
the
11th
seat.
I
do
a
receive
sheet.
This
is
this
is
working
because
I've
not
paid
yet
I've
just
reserved
the
seat
and
if
I'm
going
here
and
do
a
curl,
you
see
that
it
says
22,
21,
22
and
11
because
from
the
scope
of
the
seed
reservation
system,
I've
just
preserved
the
seed
in
my
database.
C
C
Because
the
saga
execution
coordinator
detected
that
one
of
these
sub
transactions
failed
and
then
start
sending
requests
to
the
services
saying
you
need
to
compensate
the
failure
of
the
transactions
and
what
it's
doing
in
the
case
of
the
booking
resource
in
the
compensation
method.
It
just
finds
the
booking
and
if
it's
present
because
remember
that
I
said
that
the
compensation
method
must
be
even
put
in
so
it
means
that
I
can
call
this
method
several
times
and
I
it
should
not
fail.
C
I
should
get
the
same
result
in
this
case,
I'm
setting
if
it's
present,
delete
it
and
then,
in
this
case
I'm
just
sending
an
ssa
even
to
the
front
end,
so
they
unselect
the
seeds
so
the
seed
instead
of
being
in
this
red
or
brown,
it's
in
green
again,
and
that's
pretty
much
everything
that
I
would
like
to
show
you
again,
you've
got
the
demo
you've
seen
how
I
just
deployed.
Just
you
kind
of
apply
kubernetes,
you
could
cut
it
up
like
this.
A
That's
all
that
that's
a
great
demo
and
great
overview
of
the
saga
pattern,
just
a
comment
from
one
our
guest.
Let's
say
it's
a
more
complain
about
your
user
experience.
Skills
is
telling.
C
Exactly
I
mean
service
totally
right,
it's
just
yeah.
It
was
an
example
of
that
I
found
out
of
you
know:
ella
ray
okay,
but
you
but
of
microprofile
array.
They
just
developed
an
example,
and
they
had
this
front
end
and
said:
okay,
I'm
going
to
just
take
the
front
end
and
and
double
up.
Let's
say
the
back
end
in
in
quercus.
I
checked
the
license
and
it
was
apache
v2
license.
So
there's
no
there's
no.
B
C
B
A
You
know
our
guests
are
very
high
demanding,
so
they
they
their
level
of
user
experience.
Skills
are
very
high,
so
so,
and
let
me
ask
you
some
some
suggestions
if
you
have
it
regarding
debugging
or
this
very
interesting
pattern.
A
In
this
case,
we
do
have
just
two
transactions
to
manage,
but
when
we
have
more
than
five
six
it
in
one
psychopath,
do
you
have
any
advice?
Suggestion
indication
how
to
manage
it.
C
Yeah
yeah,
in
this
case
it
could
be
yeah
tricky.
In
fact,
debugging
microservice
architecture
can
be
tricky
and
the
good
thing
is
that
the
lra
coordinator
has
an
endpoint
that
you
can
get.
For
example,
let
me
give
me
the
current
saga
transactions
started.
Let
give
me
all
the
sub
transactions
or
or
giving
a
cyber
transaction,
give
me
the
real
estate
of
the
of
the
cycle
transactions.
You
can
say:
okay
now
we
are
in
this
in
this
point
or
in
this
other
point
or
yeah.
C
Now
it's
compensating
odd,
it's
fairly,
compensating
this
or
that,
so
it
offers
this
way.
It's
true
that
it's
not
easy
and
yeah
also.
I
would
say
that
the
log
lines
are
pretty
pretty
good
as
well
in
that
in
the
quarter.
So
you
you
see
when
I
was
demo
in
the
site,
starting
transaction
transaction
completed
and
so
on.
So
yeah
that's
yeah.
C
Yeah
but
one
of
the
great
things
about
saga
pattern-
and
I
know
that
it's
not-
I
mean
that
it's
not
easy
to
the
back,
but
it's
not
that
hard
or
they're
not
super
hard,
because
all
the
pieces
are
isolated
on
its
own,
I
mean
there
is
no
magic.
If
you
check
the
service,
I've
got
an
end
point
that
is
named
slash
compensate,
and
I
know
that
the
saga
coordinator
executor
will
run
this
endpoint
when
there
is
a
failure,
so
I
can
simulate
these
failures
on
my
own.
C
I
can
just
go
there
and
do
a
call
to
slash
compensate
and
see
what's
happening,
so
I
know
that
it's
not
easy,
but
also
there's.
Let's
say
that
it's
reproducible,
it's
not
something
that
it's
somewhere
a
store
in
the
in
another
piece
of
software
that
you
don't
know
exactly
what
it's
doing
and
let
me
yeah.
I
know
that.
Let
me,
for
example,
think
about
suppose
that
you've
got
a
in
the
cubinet
as
well.
You
can
have
a
sidecar
container
that
is
doing
some
stuff.
If
there
is
something
filled,
how
do
you
develop?
C
I
mean
yeah,
you
know
like
something
failing
in
the
in
the
sidecar
container
or
maybe
not,
but
you
you
don't
know
exactly.
What
is
this
logic
right,
because
it's
inside
a
container
that
probably
you
do
not
develop
and
in
these
cases
the
code?
Is
there
it's
your
code,
you
for
the
reason
I
said
in
the
slides
that
this
is
a
business
transaction.
It's
it's
the
code
that
depends
on
your
business
logic
and
it's
there.
So
you
can
always
try
to
see
what's
happening
when
there
is
a
failure
right.
B
And
alex
there's
a
comment
from
kevin
in
the
chat.
He
say
that
there
is
an
advantage
of
being
able
to
decouple
your
system
with
increased
flexibility
of
deployment
and
team
segmentation.
From
from
his
note,
I
would
like
to
ask
you:
do
you
see
this
as
a
as
a
good
trade-off
between
you
know,
scalability
and
the
need
of
having
a
transaction
the
need
of
having
this
kind
of
feature?
No,
you
can
scale
up
your
application,
multiple
cloud
whatever,
but
you
need
at
some
point
to
start
that
in
a
consistent
way.
No,
no!
B
C
Yes,
well
yeah,
it
might
be
problematic
and
also
I
I
always
say
that
you,
you
read
some
some
books
and
you
always
end
up,
but
that
depends
a
lot
of
your
business
use
case.
For
example,
I
remember
reading
what,
when
use
case,
which
was
about
eventual
consistency.
This
is
another
play
or
another
kit
on
the
underground
that
you
can
say.
C
Okay,
I'm
going
to
do
eventual
consistency,
so
I
know
that
the
system
is
not
always
updated
to
the
ladders
and
grid
us
and,
for
example,
I
remember
that
reading
an
example
of
of
booking
a
hotel
room,
the
the
company
decided
it
could
be
a
good
approach
to
use
event
or
consistency,
and
you
might
say
well,
two:
two
people
can
just
book
the
same
room
right
because
it's
eventual
consistency,
but
it
says:
well,
it
doesn't
matter.
C
C
B
Right,
that's
a
good
point,
not
as
a
problem
as
a
opportunity.
You
know
to
a
feature
that
I
like
it.
B
And
you
know
about
distributed
transaction
pattern.
We
have
a
nice
article
in
our
developers.com
blog
written
by
our
colleague
biljin,
that
talk
about,
compare
and
distribute
the
transaction
pattern
for
microservices
like
what
alex
shown
today.
You
know
wrap
it
up
in
an
article,
so
please
check
out
also
our
blog
on
developersreddit.com.
B
We
have
multiple
resources
like
this
yeah
that
that
very
that's
very
interesting.
We
have
also
the
links
in
the
chat
for
the
demo
so
alex
for
the
demo.
If
I
want
to
do
the
demo
or
can
I
do
in
today
with
you
know,
you
talk
about
sandbox,
so
to
run
this
them,
I
just
need
to
go
to
sandbox
and
deploy.
C
C
All
of
the
three
kubernetes.ml
file
that
I
put
it
there
and
then
yeah.
You
can
just
go
to
the
sandbox
and,
as
I
show
start
a
mongodb
instance,
so
you
you
can
always
rewatch
this
session
to
see
how
it's
done
and
also,
if
you
are
using
mini
cube,
I
just
put
it
a
stateful
set
for
mongodb
there.
So
this
is
stateful
set,
doesn't
work
in
openshift
because
of
privileges
and
so
on.
But
if
you
are
using
mini
cube
or
kind
or
any
of
these
local
clusters,
you
can.
B
This
is
interesting
alex,
and
I
also
wanted
to
ask
you
so
kubernetes
provides
some
way
to
manage
applications.
Stateful
no,
do
you
think?
Also,
this
kind
of
microservices
need
to
be
stateful
in
the
kubernetes
way
to
find
full
application,
or
it's
enough
to
consider
as
a
generic
stateless
deployment
and
then
the
application
logic
will
care
about
that.
C
Yeah,
I
I
I
there's
a
lot
of
approaches
here
for
me,
I
know
few
companies
that
are
managing
everything
inside
the
kubernetes
cluster,
but
most
of
the
companies,
probably
because
they
are
scared
of
losing
its
data,
because
you
know
data
is
the
new
oil
right,
so
they
put
it
the
databases
inside
virtual
machines
and
all
these
state
things
happens
out
of
that
and
then
they
yeah
they
do
this
stuff
outside
that
cuban
discusses.
But
I
know
some
one
bank
here
in
spain,
but
they
are
using
the
the
wall.
C
I
mean
they're,
putting
everything
inside
communities,
they
use
a
nfs.
In
fact,
they're
using
and.
C
C
Any
kind
and
use
cases
and
depends
also
yeah
of
the
experience
that
you've
got
if
you're
really
experienced
in
the
communities
ecosystem.
Then
yeah
go
for
head
with
this,
but
maybe
you're
just
starting.
So
it's
like
okay,
let's
just
start
and
step
by
step.
Let's
get
some
confidence
of
the
system
and
then
yeah.
B
Right
right,
I
think
it's
a
it's
a
it's
a
good
point
alex
we
and
I
think
we
ended
the
show
with
the
right
point.
No
so
use
what
is
best
for
you,
but
there
are
solutions
you
can
choose
so
at
least
there's
the
freedom,
the
the
opportunity
to
choose
the
best
solution,
and
I
really
like
this
saga
pattern
for
transaction
distributed
transaction
in
the
microservices
world.
I
think
it
was
very
valuable,
so
yeah
folks,
if
you
is
there,
there's
any
there,
isn't
any
question
in
the
chat.
B
I
I
think
we
can
close
up
with
reminder
fabio,
so
we
will
come
back
next
wednesday
april.
The
6th,
with
a
session
talk
called
quarkus
intro
on
openshift
made
by
our
colleague
daniel
and
for
today,
if
you
stay
here
to
please
stay
together
with
us
on
openshift
tv,
we
have
the
level
up
hour
and
alex
today
is
dev
nation
kubernetes
day.
I
think
we
can
also
share
the
link
in
the
chat.
Do
you
want
to
say
something
about
the
national
kubernetes?
C
This
is
this
is
a
day
that
with
josh,
I
think
that
it's
like
in
three
hours
or
four
hours,
you,
you
get
it
from
basic
humanities
until
the
super
cool
q
and
as
like,
easter,
okay,
tecton
and
so
on.
So
you
have,
you
have
a
full
vision
of
what
is
kubernetes
and
what
it's
under
the
kubernetes
umbrella
or
what
is
the
communities
ecosystem
and
and
what
each
of
these
things
do
when
they
are
together
with
communities.
B
So
I
think
alex
is
also
a
nice
warming
up
for
kubecon,
jo
coming
in
may.
So
this
is
a
kind
of
a
start.
You
know
start
dealing
with
kubernetes,
kubecon
and
kubernetes
stuff.
I
see.
There's
a
kubernetes
beginner
intermediate
advanced
checked
on
issue
service
mesh
kennedy
server.
Let's
please
register
today
to
join
the
session.
It's
all
live,
live
demos
here
only
live
demos.