using docker, neo4j, and spring cloud for developing microservices
TRANSCRIPT
![Page 1: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/1.jpg)
Unless otherwise indicated, these slides are © 2016 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Kenny Bastani, Spring Developer Advocate, Pivotal @kennybastani
![Page 2: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/2.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Speaker Intro - Kenny Bastani
2
![Page 3: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/3.jpg)
Ranking Twitter ProfilesUsing PageRank
3 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 4: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/4.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
PageRank algorithm
4
![Page 5: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/5.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
PageRank algorithm
5
![Page 6: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/6.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example6
![Page 7: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/7.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example7
![Page 8: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/8.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example8
![Page 9: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/9.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Tools we’ll be using
! Spring Boot
! Neo4j
! Apache Spark
! Docker
! RabbitMQ
9
![Page 10: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/10.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Containerize all the things!
10
![Page 11: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/11.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example11
![Page 12: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/12.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example12
![Page 13: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/13.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example13
![Page 14: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/14.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example14
![Page 15: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/15.jpg)
Connecting Neo4j and Apache Spark…to submit PageRank jobs
15 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 16: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/16.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Request new Apache Spark job
16
Algorithm TypeRelationship Type
![Page 17: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/17.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Export Neo4j graph to HDFS
17
New Job Request
HDFS Path: /../../graph.csv
Job Type: pagerank
![Page 18: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/18.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Encoding a graph as an edge list
18
edge list
G B
H B
I B
K B
E B
F B
J B
D B
G E
H E
I E
K E …
![Page 19: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/19.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Import edge list to Apache Spark
19
Process Job Request
HDFS Path: /../../graph.csv
Job Type: pagerank
graph.csv
0 1
1 2
2 3
0 3
2 1 …
![Page 20: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/20.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Apply results back to Neo4j
20
Completed Job
HDFS Path: /../../results.csv
Job Type: pagerank
results.csv
0 .56
1 .42
2 .14
3 .25 …
![Page 21: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/21.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Graph processing platform
21
Algorithm TypeRelationship Type
![Page 22: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/22.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
docker-compose.yml
! Demo
22
![Page 23: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/23.jpg)
Building Microservices
23 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 24: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/24.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Building Microservices
24
![Page 25: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/25.jpg)
25 https://github.com/kbastani/spring-boot-graph-processing-example
Building Microservices
![Page 26: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/26.jpg)
26
Creating Spring Data Neo4j Repositories
https://github.com/kbastani/spring-boot-graph-processing-example
![Page 27: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/27.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
What our application needs
! Repositories
• User repository (to manage and import users)
• Follows repository (to manage and import following relationships)
• Custom Cypher queries mapped to repository methods
! Domain model
• User — (our node entity)
• Follows — (our relationship entity)
! REST API
• Expose the resources of the domain as a REST API
27
![Page 28: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/28.jpg)
Creating Spring Data Neo4j Repositories
28 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 29: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/29.jpg)
Creating Spring Data Neo4j Repositories
29 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 30: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/30.jpg)
Creating Spring Data Neo4j Repositories
30 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 31: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/31.jpg)
Creating Spring Data Neo4j Repositories
31 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 32: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/32.jpg)
Creating Spring Data Neo4j Repositories
32 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 33: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/33.jpg)
Creating Spring Data Neo4j Repositories
33 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 34: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/34.jpg)
Exposing repository APIs using Spring Data REST
34 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 35: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/35.jpg)
Exposing repository APIs using Spring Data REST
35 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 36: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/36.jpg)
Exposing repository APIs using Spring Data REST
36 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 37: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/37.jpg)
Connecting to the Twitter API
37 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 38: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/38.jpg)
38 https://github.com/kbastani/spring-boot-graph-processing-example
Connecting to the Twitter API
![Page 39: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/39.jpg)
Connecting to the Twitter API
39 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 40: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/40.jpg)
Connecting to the Twitter API
40 https://github.com/kbastani/spring-boot-graph-processing-example
We can override these properties as environment variables at runtime
![Page 41: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/41.jpg)
41 https://github.com/kbastani/spring-boot-graph-processing-example
Connecting to the Twitter API
![Page 42: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/42.jpg)
42 https://github.com/kbastani/spring-boot-graph-processing-example
Connecting to the Twitter API
![Page 43: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/43.jpg)
Scheduling new PageRank jobs
43 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 44: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/44.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Scheduling PageRank jobs from Neo4j
44
![Page 45: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/45.jpg)
Scheduling new PageRank jobs
45 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 46: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/46.jpg)
Ranking Dashboard
46 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 47: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/47.jpg)
47 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 48: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/48.jpg)
Ranking dashboard
48 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 49: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/49.jpg)
49 https://github.com/kbastani/spring-boot-graph-processing-example
Ranking dashboard
![Page 50: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/50.jpg)
Adding static web content
50 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 51: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/51.jpg)
Ranking dashboard
51 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 52: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/52.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Ranking dashboard
52
![Page 53: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/53.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Add seed profiles
53
![Page 54: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/54.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Choose 3 seed profiles
54
![Page 55: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/55.jpg)
Creating Spring Data Neo4j Repositories
55 https://github.com/kbastani/spring-boot-graph-processing-example
![Page 56: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/56.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example
Discover new users and update rankings
56
![Page 57: Using Docker, Neo4j, and Spring Cloud for Developing Microservices](https://reader031.vdocuments.site/reader031/viewer/2022021813/5885b0e11a28abd2348b6771/html5/thumbnails/57.jpg)
https://github.com/kbastani/spring-boot-graph-processing-example57
Learn More. Stay Connected.
! Twitter: @kennybastani
! Spring: spring.io/team/kbastani
! Blog: kennybastani.com
! GitHub: github.com/kbastani
Twitter: twitter.com/springcentral
YouTube: spring.io/video
LinkedIn: spring.io/linkedin
Google Plus: spring.io/gplus