Share
Embed
Reactive meets Data Access
Slides to the talk I gave at Devoxx PL 2017.
Links:
* Spring Data Examples: https://github.com/spring-projects/spring-data-examples
* Spring Data wiki: https://github.com/spring-projects/spring-data-commons/wiki
* Spring Project release calendar: https://spring-calendar.cfapps.io/
* Code: http://mp911.de/reactive-meets-data-access-code
Mark Paluch
June 21, 2017
Transcript
25 slides
-
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Accessing Data today 2 Request Data access Remote data service I/O Wait ! This one is waiting -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Accessing Data today 3 Request Data access Remote data service Multiple calls Bulk fetch ! -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Asynchronous data access 4 Request Data access Requires synchronization Still waiting, eh? " # $ -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 5 -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 6 -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 7 -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 8 -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 9 -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Conditional asynchronous access 10 % Future Hell -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ ! Keep resources busy ! Connection contention ! Usually synchronous/blocking ! Multiple requests ! Asynchronous isn’t always a good answer 11 Todays’ Data Access -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Scaling 12 & & & & & & & & & & & & & & & & & & & -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Change the level of abstraction 13 Data as Stream Reactive execution model -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 14 List<T> Iterator<T> Future<T> Future<List<T>> .get() for-each .hasNext() Request thread pulls -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 15 Publisher<T> I/O thread push -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 16 Publisher Stream (Publisher) Subscriber Demand Data -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ ! Immutable ! Push-Stream ! Iterator, java.stream.Stream are Pull-Streams ! Demand-Aware (Backpressure) 17 Reactive Streams -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Going reactive with Spring Data 18 Project Reactor 3.0 Spring Data 2.0 Spring Framework 5.0 -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 19 Mono<T> Flux<T> 0..1..Error 0..N..Error -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ ! Reactive Template API ! Reactive Repository support ! Supported data stores (Reactive Streams) ! MongoDB ! Apache Cassandra ! Redis ! Couchbase (RxJava 1 driver) 20 Spring Data -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 21 Reactive Template API <T> Mono<T> insert(T objectToSave) <T> Mono<T> insert(Mono<T> objectToSave) -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 22 Let’s code… -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 23 Spring Data 2.0 Java 8 API Ready for Java 9 Fluent MongoDB API MongoDB Collation support Elasticsearch 5.4 Cassandra Lightweight transactions Cassandra Query & Update objects Composable repositories Kotlin extensions On the way to non-null API Consistent CRUD repository method names MongoDB Document API New Redis Cache Cassandra module merge -
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Feedback Welcome -
Unless otherwise indicated, these slides are © 2013-2017 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Resources ! Spring Data Examples – Repository @ Github ! Spring Data wiki (Release trains, planning) – Wiki ! Spring projects release calendar – Google Calendar ! Slides – Speakerdeck (mp911.de/reactive-meets-data-access) ! Code – GitHub (mp911.de/reactive-meets-data-access-code) ! Chat with us on Gitter! 25 @mp911de