RPC leads to many poor design choices. See how the Muon project can help you build fully reactive, message based APIs instead, and how that can improve your system design and performance.
77. Reactive: Technical Interaction Models?
Reactive
API
"I want to trade X for Y"
"I offer 10*Y in 2 minutes, or Z now"
"I'll take 10Y"
78. Reactive: Technical Interaction Models?
Reactive
API
"I want to trade X for Y"
"I offer 10*Y in 2 minutes, or Z now"
"I'll take 10Y"
"Here is Y"
79. Reactive: Technical Interaction Models?
Reactive
API
"I want to trade X for Y"
"I offer 10*Y in 2 minutes, or Z now"
"I'll take 10Y"
"Here is Y"
"Here is Y"
"Here is Y"
80. Reactive: Technical Interaction Models?
Reactive
API
"I want to trade X for Y"
"I offer 10*Y in 2 minutes, or Z now"
"I'll take 10Y"
"Here is Y"
"Here is Y"
"Here is Y"
"Slow down"
81. Reactive: Technical Interaction Models?
Reactive
API
"I want to trade X for Y"
"I offer 10*Y in 2 minutes, or Z now"
"I'll take 10Y"
"Here is Y"
"Here is Y"
"Here is Y"
"Slow down"
.....
85. Reactive: Technical Interaction Models?
Reactive
API
"I want to trade X for Y"
"I offer 10*Y in 2 minutes, or Z now"
"I'll take 10Y"
"Here is Y"
"Here is Y"
"Here is Y"
"Slow down"
.....
104. The Muon Model
Discovery
Transport
Network
….
Protocol
Client
channel N
channel
channel channel Service X
Service 2
Service 1
API
App Code
….
1) Your code
uses an API
2) The API
creates a
Protocol
3) The Protocol
communicates
using
messages
4) A transport
routes them over
the network
105. The Muon Model
Discovery
Transport
Network
….
Protocol
Client
channel N
channel
channel channel Service X
Service 2
Service 1
API
App Code
….
1) Your code
uses an API
2) The API
creates a
Protocol
3) The Protocol
communicates
using
messages
4) A transport
routes them over
the network
106. The Muon Model
Discovery
Transport
Network
….
Protocol
Client
channel N
channel
channel channel Service X
Service 2
Service 1
API
App Code
….
1) Your code
uses an API
2) The API
creates a
Protocol
3) The Protocol
communicates
using
messages
4) A transport
routes them over
the network
107. The Muon Model
Discovery
Transport
Network
….
Protocol
Client
channel N
channel
channel channel Service X
Service 2
Service 1
API
App Code
….
1) Your code
uses an API
2) The API
creates a
Protocol
3) The Protocol
communicates
using
messages
4) A transport
routes them over
the network
136. The Muon Model
Discovery
Transport
Network
….
Protocol
Client
channel N
channel
channel channel Service X
Service 2
Service 1
API
App Code
….
1) Your code
uses an API
2) The API
creates a
Protocol
3) The Protocol
communicates
using
messages
4) A transport
routes them over
the network
137. Protocol - Events
My App
AMQP
Event Proto
Server
Mongo |
Cassandra
Event Proto
Client
AMQP
Transport
AMQP
Transport
[event store]
Standalone Event Store – Multi Process
138. Muon Event Log API
A Message based API
http://github.com/muoncore/stack-events
139. Java Client
Muon muon = getMuon();
EventClient client = new DefaultEventClient(muon);
Order order = ...
client.event(
ClientEvent.ofType("OrderPlaced")
.payload(order)
.stream("/orders").build())
Muon Event Log API
140. Java Client
Muon muon = getMuon();
EventClient client = new DefaultEventClient(muon);
Subscriber<Event> s = … (RxJava, Reactor etc)
client.replay("/requests", REPLAY_ONLY, s);
Muon Event Log API
142. Protocol - Events
My App
AMQP
Event Proto
Server
Mongo |
Cassandra
Event Proto
Client
AMQP
Transport
AMQP
Transport
[event store]
Standalone Event Store – Multi Process
146. Order Stream
Notification Stream
Payment Stream
Event Store (Kafka?)
Payment
Processor
Hub and SpokeHub and Spoke
Fraud
Analysis
Order AR
Notification
Manager
BoomBoom
147. Order Stream
Notification Stream
Payment Stream
Event Store (Kafka?)
Payment
Processor
Hub and SpokeHub and Spoke
Fraud
Analysis
Order AR
Notification
Manager
BoomBoom
Single Point ofSingle Point of
Screw UpScrew Up
:-(:-(
155. Thoughts
Uses Muon Event Log API.
All Muon implementations can
contribute/ consume data (jvm, node, browser etc)
156. Thoughts
Uses Muon Event Log API.
All Muon implementations can
contribute/ consume data (jvm, node, browser etc)
Runs on any event store
that implements (or is wrapped by)
the Muon Event Log API
158. When to use Muon
Want APIs, but better than just RPC?
Defer "strategic" tech decisions till later
Thinking of using a websocket?
or a message queue?
161. There's more...
More types of API available ...
Multiple transports available
me@daviddawson.me http://muoncore.io
162. There's more...
More types of API available ...
Multiple transports available
Any infrastructure you like!
me@daviddawson.me http://muoncore.io
163. There's more...
More types of API available ...
Multiple transports available
Any infrastructure you like!
Want to extend/ contribute? Join us at
me@daviddawson.me http://muoncore.io