Query by Time
Request
Response
(chunk)
Response
(complete)
Query
Emit
elements
Result processing
Next page
Slide 28
Slide 28 text
Outlook
•Cassandra driver 4.0 in the works
•Likely support for reactive execution model
•Emit items as they are received
https://github.com/datastax/java-driver/tree/4.x • https://datastax-oss.atlassian.net/browse/JAVA-1505
Slide 29
Slide 29 text
Couchbase
•Reactive driver driver
•Based on Netty and RxJava 1
•Multiple connection schemes
Command by Time
Request
Command
Command
(subscription)
Response
(chunk)
Response
(complete)
Slide 32
Slide 32 text
Outlook
•Couchbase driver likely to move to RxJava 2
•No tickets/decisions yet
Slide 33
Slide 33 text
Imperative and Reactive Together
Slide 34
Slide 34 text
Blocking with Imperative Programming
Slide 35
Slide 35 text
Blocking with Reactive Programming
Slide 36
Slide 36 text
Imperative and Reactive
@Component
public class ApplicationInitializer {
ReactiveMongoOperations ops;
@PostConstruct
public void postConstruct() {
ops.remove(Person.class).all().block();
}
}
Slide 37
Slide 37 text
Imperative and Reactive
@Component
public class ApplicationInitializer {
ReactiveMongoOperations ops;
@PostConstruct
public void postConstruct() {
ops.remove(Person.class).all().block();
}
}
Slide 38
Slide 38 text
Event Loop
Event Loop
(single Thread)
Slide 39
Slide 39 text
Event Loop
Event Loop
(single Thread)
Slide 40
Slide 40 text
Event Loop
Process next item
Callback
Register Callback
Return
Work
Database
Computation
File
I/O
Event Loop
(single Thread)
Work Queue
Work
Request Callback
Slide 41
Slide 41 text
Event Loop
Process next item
Callback Work
Event Loop
(single Thread)
Work Queue
Request Callback
Slide 42
Slide 42 text
Event Loop
Event Loop
(single Thread)
Work Queue Process next item
Work
Callback
Work
Wait for
Request completion
Return
Request
Request Callback
Slide 43
Slide 43 text
Event Loop
Event Loop
(single Thread)
Work Queue Process next item
Work
Callback
Work
Wait for
Request completion
Return
Request
Request Callback
Slide 44
Slide 44 text
Thou shalt not block
Slide 45
Slide 45 text
Resources
•Slides – mp911.de/uhd-springio18
•Example Code – mp911.de/uhd-code
•Spring Data Examples – Repository @ Github
•Find us on Gitter!