Slide 1

Slide 1 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Christoph Strobl, Pivotal Software Inc. @stroblchristoph Spring Data, Hypermedia and the Cloud

Slide 2

Slide 2 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 2

Slide 3

Slide 3 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 3 “Spring Data provides a familiar and consistent Spring based programming model retaining store specific features and capabilities. O.Gierke

Slide 4

Slide 4 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Data 4 Abstraction relational non-relational JDBC* MongoDB Neo4j JPA* Redis Couchbase Cassandra Solr Spring Data

Slide 5

Slide 5 text

Core KeyValue Gemfire JPA Solr Elasticsearch Cassandra Couchbase Redis MongoDB Community
 modules Core
 modules Neo4j REST Foundational Store modules Web APIs

Slide 6

Slide 6 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The anatomy of a Spring Data module 6 where needed where needed where reasonable Templates Object mapping Repositories Spring Container Integration CDI Support

Slide 7

Slide 7 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 7 Today we’ll have a look at… Spring Boot App

Slide 8

Slide 8 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 8 “Spring Boot makes it easy to create Spring-powered, production-grade applications and services with absolute minimum fuss. The Spring Boot Team

Slide 9

Slide 9 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ One Slide App @SpringBootApplication public class StoreApp { ! public static void main(String[] args) { SpringApplication.run(StoreApp.class, args); } ! ! ! ! ! } 9 Page findByAddressLocationNear(Point location, Distance distance, Pageable pageable); interface StoreRepository extends PagingAndSortingRepository { ! ! }

Slide 10

Slide 10 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ § Hypermedia 10 Hypermedia is Coming image source:
 terrordesigners.com

Slide 11

Slide 11 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Hypermedia Presentation of data and navigation controls at the same time 11

Slide 12

Slide 12 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Data REST 12 HATEOAS JSON HAL JSON Schema GET PUT POST PATCH Conditional ALPS Repositories Projections Resource http

Slide 13

Slide 13 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Data REST 13 @SpringBootApplication public class StoreApp { ! public static void main(String[] args) { SpringApplication.run(StoreApp.class, args); } ! interface StoreRepository extends PagingAndSortingRepository { ! ! } } Page findByAddressLocationNear(Point location, Distance distance, Pageable pageable); @RestResource(rel = "by-location") org.springframework.boot spring-boot-starter-data-rest

Slide 14

Slide 14 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Let’s try this local… 14 $> mvn spring-boot:run org.springframework.boot spring-boot-maven-plugin

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 16 image source:
 terrordesigners.com The Cloud 
 is waiting! image source: idigitaltimes.com

Slide 17

Slide 17 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 17 “Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications.
 ! docker.com

Slide 18

Slide 18 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Run on Docker 18 FROM java:8 VOLUME /tmp ADD spring-data-rest-starbucks.jar app.jar RUN bash -c 'touch /app.jar' ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar", "/app.jar"] com.spotify docker-maven-plugin 0.2.12 cstrobl/${project.artifactId} 
 src/main/docker
 ... $> mvn package docker:build $> docker run -p 8080:8080 -t cstrobl/spring-data-rest-starbucks

Slide 19

Slide 19 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 19

Slide 20

Slide 20 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 20 “Lattice aspires to make clustering containers easy. It packages components from Cloud Foundry to provide a cloud native platform for individual developers and small teams.
 ! lattice.cf

Slide 21

Slide 21 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Run on Lattice 21 $> mvn package docker:build $> docker push cstrobl/spring-data-rest-starbucks $> ltc create starbucks cstrobl/spring-data-rest-starbucks --memory-mb 1024
 $> ltc scale starbucks 2

Slide 22

Slide 22 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 22

Slide 23

Slide 23 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 23 “Pivotal Cloud Foundry is a Platform as a Service that supplies developers with a ready-to-use cloud computing environment and application services, all hosted by virtualized servers on your existing public and private infrastructure. ! pivotal.io

Slide 24

Slide 24 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Run on Pivotal Cloud Foundry 24 $> mvn package $> cf push starbucks -p target/spring-data-rest-starbucks.jar --no-start $> cf bind-service starbucks mongo $> cf start starbucks
 $> cf scale starbucks -i 2 -m 512M

Slide 25

Slide 25 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 25

Slide 26

Slide 26 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 26 Go to start.spring.io 
 get Spring Boot with Spring Data 
 and deploy on
 Cloud Foundry, Docker and Lattice
 or simply anywhere you want!

Slide 27

Slide 27 text

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Resources (alphabetical) § docker.com § hub.docker.com § lattice.cf § mongodb.org § projects.spring.io/spring-boot 27 § projects.spring.io/spring-data § run.pivotal.io § start.spring.io § vagrantup.com § virtualbox.org