Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in Spring Data Hopper?

What's new in Spring Data Hopper?

Recap of the Spring Data Hopper release train and a brief outlook on what to expect from the Ingalls release.

Christoph Strobl

August 02, 2016
Tweet

More Decks by Christoph Strobl

Other Decks in Programming

Transcript

  1. 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/ What’s New in Spring Data? Mark Paluch • Christoph Strobl @mp911de • @stroblchristoph
  2. 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/ 2
  3. 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/ Agenda 3 Overview Core Themes Store modules Q&A
  4. 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/ Hopper Release 4 image source: 
 https://commons.wikimedia.org (License: CC0)
  5. 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/ Spring Data Release train BOM 5 <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-releasetrain</artifactId> <version>Hopper-SR2</version> <scope>import</scope> <type>pom</type> </dependency>
  6. 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/ Module setup Hopper 6 Commons Neo4j Gemfire JPA Solr ElasticSearch REST Cassandra Couchbase Redis MongoDB Community
 modules Core
 modules
  7. 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/ Release train - Spring Framework baselines 7 Dijkstra May 2014 Spring 3.2 Evans August 2015 Spring 4.0 Fowler March 2015 Spring 4.0 Gosling September 2015 Spring 4.1 Hopper April 2016 Spring 4.2 Ingalls* 2016 Spring 4.2
  8. 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/ Major Dependency upgrades for Hopper • Upgraded Spring Framework baseline to 4.2 • Upgrade to Querydsl 4 • Upgrade to Elasticsearch 2.0 • Upgrade to Solr 5 8
  9. 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/ Core Themes 9
  10. 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/ Query by Example • Value objects provided by Spring Data Commons • Supported by Spring Data JPA and Spring Data MongoDB 10 Example<User> example = Example.of( " " " ); " " repository.findAll(example); new User("jon", "snow"), ExampleMatcher.matching() .withMatcher("lastname", matcher -> matcher.ignoreCase().startsWith())
  11. 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/ Demo 11 Query by Example
  12. 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/ Projections in Repository Query Methods • First time seen with Evans in Spring Data REST • Projections to reduce or enhance view of resources 12 interface CustomerProjection { " String getFirstname(); " } interface CustomerSummary { " @Value( "#{target.firstname + ' ' + target.lastname}") String getFullName(); @Value("#{@mybean.someMethod(target)}") String getSomeCalculatedValue(); " } Closed Projection Open Projection
  13. 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/ 13 Demo Projections
  14. 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/ Spring Data Commons • Support for Composed Annotations • Support JDK 8 and Guava Optional on repository query parameters • Allow aliasing of Querydsl web bindings • Converter support for JSR-310's ZoneId. 14
  15. 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/ 15 Demo Composed Annotations
  16. 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/ 16 Demo Wrapped Parameters
  17. 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/ Store Specifics 17
  18. 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/ Spring Data Redis " • Deprecated jredis and srp drivers • Redis Cluster support (Jedis & Lettuce) • Support for object mapping and repositories • Redis SSL support 18
  19. 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/ 19 Demo Redis Cluster
  20. 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/ • Customizable entity lookup. self: { href: "http://localhost:8080/countries/47631a38-548f-11e6-beb8-9e71128cae77" }, Spring Data REST 20 @Component class SpringDataRestCustomization extends 
 RepositoryRestConfigurerAdapter { " @Override public void 
 configureRepositoryRestConfiguration( RepositoryRestConfiguration config) { " config.withCustomEntityLookup(). forRepository(CountryRepository.class, Country::getName, 
 CountryRepository::findByName); } } countries: [{ name: "austria", _links: { self: { href: "http://localhost:8080/countries/austria" }, country: { href: "http://localhost:8080/countries/austria" } } }, { name: "germany", _links: { ...
  21. 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/ • Customizable reference entity lookup. Spring Data REST 21 @Component class SpringDataRestCustomization extends 
 RepositoryRestConfigurerAdapter { " @Override public void 
 configureRepositoryRestConfiguration( RepositoryRestConfiguration config) { " config.withCustomEntityLookup(). forLookupRepository(CountryRepository.class). withIdMapping(Country::getName). withLookup(CountryRepository::findByName); } } { "zipCode" : "…", "country" : "Germany" } "_links" { "country" : { "href" : "http://localhost:8080/countries/47631a38-548f-11e6-beb8-9e71128cae77" } }
  22. 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/ Spring Data Gemfire • Support for OQL specific features via 
 Annotations • @Trace • @Limit 22 • Annotation based eviction strategies • @TimeToLiveExpiration • @IdleTimeout interface UserRepository
 extends GemfireRepository { @Trace @Limit(5) @Hint("UsernameIdx") List<User> findByUsernameLike(String username); } @TimeToLiveExpiration( timeout="300", action="LOCAL_DESTROY") @IdleTimeoutExpiration( timeout="120", action="LOCAL_INVALIDATE") class DomainObject { //… }
  23. 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/ Spring Data Couchbase • N1QL Integration. • SQL extension for JSON. • Allows sorting and Paging. • Evaluates your SpEL expressions
 and named parameters. 23 • Geospatial query support 
 via specialized Views • Support for auditing annotations. interface PartyRepository extends Repository<Party, String> { @Dimensional( designDocument="partyGeo", spatialViewName="byLocation") List<Party> findByLocNear(Point p, Distance d); } interface UserRepository extends Repository<User, String> { " List<User> findByUsernameContains(String s); @Query List<User> findByAgeBetween(int min, int max); }
  24. 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/ Spring Data Elasticsearch • Upgrade to Elasticsearch 2 • Removed Facet feature -> Please use Aggregations instead. 24
  25. 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/ Outlook - Ingalls 25 image source: 
 https://commons.wikimedia.org (License: CC0 BY-SA 3.0)
  26. 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/ Module setup Hopper 26 Commons Neo4j Gemfire JPA Solr ElasticSearch REST Cassandra Couchbase Redis MongoDB Community
 modules Core
 modules
  27. 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/ Module setup Ingalls 27 Commons Neo4j Gemfire JPA Solr ElasticSearch REST Cassandra Couchbase Redis MongoDB Community
 modules Core
 modules
  28. 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/ Outlook • Upgrade to Cassandra 3.0 " • Performance improvements • General: Method handles for property access in object mapping. • MongoDB: DBRef loading improvements. • Couchbase: Async API usage for view based queries.
 • Redis • Partial updates in Redis repositories. • Support for GEO commands and derived findBy…Near/Within queries. " • MongoDB • Aggregation Framework improvements. • $min / $max support in MongoDB.
 • REST: • Support for inbound projections using JSONPath / XPath (via XMLBeam). • Support for VND Error and RFC7807 (Problem details for HTTP APIs). • Support for additional hypermedia formats (Siren, Affordances). 28
  29. 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/ Oh, wait - one more thing 29
  30. 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/ ..maybe you’ve heard of Reactive Programming 30
  31. 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/ Spring Data 2.0 • Upgrade JDK baseline to 8 • Upgrade Spring Framework baseline to 5.0 • Reactive support for MongoDB, Redis and Couchbase • Store implementations using either RxJava or Project Reactor • Reactive wrapper type conversion on Repository level 31 ! STAY TUNED !
  32. 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/ 32 Demo Reactive Data Access
  33. 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/ Related Sessions • Tue, 2nd, August, 2016 • 3:20 pm – Christoph Strobl
 Spring Data Redis Cluster & Repositories " • Wed, 3rd, August, 2016 • 2:00 pm – Sébastien Deleuze, Stéphane Maldini
 A Lite Rx API for the JVM
 • Wed, 3rd, August, 2016 • 3:20 pm – John Blum, Mark Paluch
 Outlook: Spring Data Cassandra 1.5
 33
  34. 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/ Related Sessions • Thu, 4th, August, 2016 • 9:00 am – John Blum, Luke Shannon 
 Spring Data and In-Memory Data Management in Action " • Thu, 4th, August, 2016 • 11:10 am – Oliver Gierke
 Advanced Spring Data REST " • Thu, 4th, August, 2016 • 11:45 am – Viktor Gamov, Neil Stevenson 
 Spring Data Hazelcast: Fluently Accessing Distributed Repositories
 34
  35. 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! 35
  36. 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/ Resources • Slides – TBA • Spring Data Examples – Repository @ Github • Spring Data wiki (Release trains, planning) – Wiki • Spring projects release calendar – Google Calendar " • Chat with us on Gitter! 36
  37. 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/ Learn More. Stay Connected. Follow us @SpringData @springcentral spring.io/blog @pivotal pivotal.io/blog @pivotalcf http://engineering.pivotal.io Talk to us spring-projects/spring-data
  38. 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/ Safe Harbor Statement • The following is intended to outline the general direction of Pivotal's offerings. It is intended for information purposes only and may not be incorporated into any contract. Any information regarding pre-release of Pivotal offerings, future updates or other planned modifications is subject to ongoing evaluation by Pivotal and is subject to change. This information is provided without warranty or any kind, express or implied, and is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions regarding Pivotal's offerings. These purchasing decisions should only be based on features currently available. The development, release, and timing of any features or functionality described for Pivotal's offerings in this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward looking information in this presentation. 38