5. • We
don’t
want
ACID
all
of
the
/me
• We
want
to
pick
the
bits
we
need
when
we
need
them
• We
want
to
use
the
context
of
our
business
requirement
to
work
our
way
around
the
ones
we
don’t
need.
7. Why
do
we
care?
Without
versioning
it’s
a
free-‐for-‐all.
• What
changed?
• Was
something
overwri1en?
• How
can
you
prevent
concurrent
updates?
• What
did
the
system
look
like
10
seconds
ago.
• How
can
I
provide
a
consistent
view?
• How
to
I
ensure
ordering
of
updates
in
an
asynchronous
system?
20. The
Collec/ons
Cache
Trigger
Appends
to
Collec/on
collec/onsCache.put(key,
val);
A
[O1,
O2,
O3..]
B
[O1,
O2,
O3..]
collec/onsCache.invoke(key,
C
[O1,
O2,
O3..]
new
LastValueGe1er());
…or
override
backing
store
D
[O1,
O2,
O3..]
Collec/onsCache
21. So
we
have
3
pa1erns
for
managing
versioning
whilst
retaining
key
based
access
22. Using
versioning
to
manage
concurrent
changes
Mul/
Version
Concurrency
Control
(MVCC)
23. Cache
Version
1
Coherence
Trigger
Version
2
New
Version
=
Old
Version
+
1
??
24. Concurrent
Object
Update
(2
Clients
update
the
same
object
at
the
same
/me)
Client1
Client2
A.1
A.2
A.2
29. Reliable
PutAll
We
want
putAll
to
tell
us
which
objects
failed
the
write
process
30. Reliable
PutAll
Node
Node
Client
Extend
Node
Node
Node
Node
Invocable:
• Split
keys
by
member
Invocable:
• Send
appropriate
values
• Write
entries
to
to
each
member
backing
map
(we
• Collect
any
excep/ons
use
an
EP
for
returned
this)
31. This
gives
us
a
reliable
mechanism
for
knowing
what
worked
and
what
failed
39. The
trivial
approach
to
joins
Get
Get
Get
Get
Get
Get
Get
Cost
Ledger Source
Transac MTMs
Legs
Cost
Centers
Books
Books
-‐/ons
Centers
Network
Time
40. Server
Side,
Sharded
Joins
Use
KeyAssocia/on
to
keep
related
en//es
together
Orders
Shipping
Log
Common
Key
41. Server
Side,
Sharded
Joins
Transactions
Aggregator joins
Mtms
data across cluster
Cashflows
42. So
we
have
a
set
of
mechanisms
for
reading
and
wri/ng
groups
of
related
objects.
46. What
is
the
cluster
singleton
good
for
• Adding
indexes
• Loading
data
• Keeping
data
up
to
date
• Upda/ng
cluster
/me
• You
can
probably
think
of
a
bunch
of
others
yourselves.
47. Code
for
Cluster
Singleton
//run in a new thread on every Cache Server
while (true) {
boolean gotLock = lockCache.lock("singletonLock", -1);
if (gotLock) {
//Start singletons
wait();
}
}
49. Bi-‐temporal
public
interface
MyBusinessObject{
//data
Business
public
Date
getBusinessDate();
Time
public
Date
validFrom();
System
public
Date
validTo();
Time
}