Just data; what about computation?
Bounded Join Semilattices
Sunday, October 13, 13
Slide 61
Slide 61 text
Composability desired.
Bounded Join Semilattices
Sunday, October 13, 13
Slide 62
Slide 62 text
CALM Theorem
Sunday, October 13, 13
Slide 63
Slide 63 text
Consistency as Logical Monotonicity
CALM Theorem
Sunday, October 13, 13
Slide 64
Slide 64 text
Consistent given async; all monotone functions.
CALM Theorem
Sunday, October 13, 13
Slide 65
Slide 65 text
Identify non-monotone functions.
CALM Theorem
Sunday, October 13, 13
Slide 66
Slide 66 text
Disorderly Programming
Sunday, October 13, 13
Slide 67
Slide 67 text
Order-independent, explicit order-dependent.
Disorderly Programming
Sunday, October 13, 13
Slide 68
Slide 68 text
Prototype language: Bloom
Disorderly Programming
Sunday, October 13, 13
Slide 69
Slide 69 text
Bloom
Sunday, October 13, 13
Slide 70
Slide 70 text
Based in a logic called Dedalus.
Bloom
Sunday, October 13, 13
Slide 71
Slide 71 text
Disorderly language.
Bloom
Sunday, October 13, 13
Slide 72
Slide 72 text
Lattices and mappings between lattices.
Bloom
Sunday, October 13, 13
Slide 73
Slide 73 text
Highlights non-monotonicity.
Bloom
Sunday, October 13, 13
Slide 74
Slide 74 text
Operational model.
Bloom
Sunday, October 13, 13
Slide 75
Slide 75 text
Local clock; local execution; local state.
Bloom
Sunday, October 13, 13
Slide 76
Slide 76 text
Timestepped execution.
Bloom
Sunday, October 13, 13
Slide 77
Slide 77 text
Local updates; system events; network.
Sunday, October 13, 13
Slide 78
Slide 78 text
Bloom rules; merge functions.
Sunday, October 13, 13
Slide 79
Slide 79 text
Network; next.
Sunday, October 13, 13
Slide 80
Slide 80 text
Chat server.
Bloom
Sunday, October 13, 13
Slide 81
Slide 81 text
module ChatProtocol
state do
channel :connect, [:@addr, :client] => [:nick]
channel :mcast
end
end
examples/chat/chat_protocol.rb
Sunday, October 13, 13
Slide 82
Slide 82 text
class ChatServer
include Bud
include ChatProtocol
state { table :nodelist }
bloom do
nodelist <= connect.map { |c| [c.client, c.nick] }
mcast <~ (mcast * nodelist).pairs { |m,n| [n.key, m.val] }
end
end
examples/chat/chat_server.rb
Sunday, October 13, 13
Slide 83
Slide 83 text
Lattices; monotonic functions.
Bloom
Sunday, October 13, 13
Slide 84
Slide 84 text
class ChatServer
include Bud
include ChatProtocol
state do
table :nodelist
channel :disconnect
end
bloom do
nodelist <= connect.map { |c| [c.client, c.nick] }
mcast <~ (mcast * nodelist).pairs { |m,n| [n.key, m.val] }
nodelist <- disconnect.map { |c| [c.client, c.nick] }
end
end
examples/chat/chat_server.rb
Sunday, October 13, 13
Slide 85
Slide 85 text
Non-monotonic; not eventually consistent.
Bloom
Sunday, October 13, 13
Slide 86
Slide 86 text
bloom do
mcast <~ stdio do |s|
[@server, [ip_port, @nick,
Time.new.strftime("%I:%M.%S"), s.line]]
end
stdio <~ mcast { |m| [pretty_print(m.val)] }
end
examples/chat/chat.rb
Sunday, October 13, 13
Slide 87
Slide 87 text
KV Store.
Bloom
Sunday, October 13, 13
Slide 88
Slide 88 text
module BasicKVS
include KVSProtocol
state do
table :kvstate, [:key] => [:value]
end
bloom :mutate do
kvstate <+ kvput {|s| [s.key, s.value]}
kvstate <- (kvstate * kvput).lefts(:key => :key)
end
bloom :get do
temp :getj <= (kvget * kvstate).pairs(:key => :key)
kvget_response <= getj do |g, t|
[g.reqid, t.key, t.value]
end
end
bloom :delete do
kvstate <- (kvstate * kvdel).lefts(:key => :key)
end
end
kvs/kvs.rb
Sunday, October 13, 13
Slide 89
Slide 89 text
module ReplicatedKVS
include KVSProtocol
include MulticastProtocol
include MembershipProtocol
import BasicKVS => :kvs
bloom :local_indir do
kvs.kvdel <= kvdel
kvs.kvget <= kvget
kvget_response <= kvs.kvget_response
end
bloom :puts do
# if I am the master, multicast store requests
mcast_send <= kvput do |k|
unless member.include? [k.client]
[k.reqid, ["put", [@addy, k.key, k.reqid, k.value]]]
end
end
kvs.kvput <= mcast_done do |m|
if m.payload[0] == "put"
m.payload[1]
end
end
# if I am a replica, store the payload of the multicast
kvs.kvput <= pipe_out do |d|
if d.payload.fetch(1) != @addy and d.payload[0] == "put"
d.payload[1]
end
end
end
bloom :dels do
mcast_send <= kvdel do |k|
unless member.include? [k.client]
[k.reqid, ["del", [@addy, k.key, k.reqid]]]
end
end
kvs.kvdel <= mcast_done do |m|
if m.payload[0] == "del"
m.payload[1]
end
end
kvs.kvdel <= pipe_out do |d|
if d.payload.fetch(1) != @addy and d.payload[0] == "del"
d.payload[1]
end
end
end
end
kvs/kvs.rb
Sunday, October 13, 13
Slide 90
Slide 90 text
CALM Analysis
Sunday, October 13, 13
Slide 91
Slide 91 text
Label asynchronous, non-monotonic.
CALM Analysis
Sunday, October 13, 13
Slide 92
Slide 92 text
Identify where coordination is needed.
CALM Analysis
Sunday, October 13, 13
Slide 93
Slide 93 text
The Conclusion
Sunday, October 13, 13
Slide 94
Slide 94 text
Prototype language.
The Conclusion
Sunday, October 13, 13
Slide 95
Slide 95 text
https://github.com/bloom-lang/bud
https://github.com/bloom-lang/bud-sandbox
Thanks! Questions?
Sunday, October 13, 13