Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016
Transcript of Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016
![Page 1: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/1.jpg)
©2016 Couchbase Inc. 1
The Couchbase Connect16 mobile app
Take our in-app survey!
![Page 2: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/2.jpg)
©2016 Couchbase Inc.
Bootiful Couchbase: Microservices with Spring
![Page 3: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/3.jpg)
©2016 Couchbase Inc.
Simon BasléSoftware Engineer, Pivotal
![Page 4: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/4.jpg)
©2016 Couchbase Inc.
Subhashni BalakrishnanSDK Engineer, Couchbase
![Page 5: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/5.jpg)
©2016 Couchbase Inc.
Agenda
• Briefly introduce Microservices
• Spring Ecosystem
• Couchbase with Spring Data
• Addressing production-ready concerns when building Microservices
![Page 6: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/6.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Why Microservices?
![Page 7: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/7.jpg)
©2016 Couchbase Inc.
Spring PlatformSpring Boot, Spring Cloud and Spring Data
![Page 8: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/8.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
From framework to platform
Spring Framework
![Page 9: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/9.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Framework Ecosystem
From framework to platform
![Page 10: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/10.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
From framework to platform
![Page 11: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/11.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Bootthe opinionated glue that ties all that together
From framework to platform
![Page 12: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/12.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
integration of various projects via starters
Spring Boot
![Page 13: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/13.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
externalized configuration management
![Page 14: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/14.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
externalized configuration management
CLI > … > JNDI > system properties > OS env > … > .properties outside jar > .properties inside jar …
![Page 15: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/15.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
auto-configuration
![Page 16: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/16.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
auto-configuration(not a mystic art)
![Page 17: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/17.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
monitoring & configuration via actuator
![Page 18: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/18.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
use Spring Cloud in Bootfor resiliency and production gradeness
![Page 19: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/19.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Circuit Breaker(Hystrix...)
![Page 20: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/20.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Distributed Configuration
![Page 21: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/21.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Service Discovery(Eureka, Consul...)
![Page 22: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/22.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Load Balancing & MicroProxies(Zuul...)
![Page 23: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/23.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Distributed Tracing(Sleuth, Zipkin...)
![Page 24: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/24.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
use Spring Data in Bootfor data access
![Page 25: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/25.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
Repository abstractionfor CRUD
![Page 26: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/26.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
Template abstractionfor lower level interactions
![Page 27: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/27.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
Query Derivation in repositoriesfor easy querying
![Page 28: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/28.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
And Much More
A lot of other aspects to integrate in Boot
![Page 29: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/29.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
And Much More
A lot of other aspects to integrate in Bootmessaging, session, security, auditing, templating, social ...
![Page 30: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/30.jpg)
©2016 Couchbase Inc.
Demo
![Page 31: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/31.jpg)
©2016 Couchbase Inc.
Spring Data CouchbaseOverview
![Page 32: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/32.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring & Couchbase
JSON JSON
![Page 33: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/33.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Pattern
Separate logic that stores and retrieves the data and maps it to the entity model from the business logic that acts on the model
![Page 34: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/34.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Pattern & Spring Data
![Page 35: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/35.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Query methods
![Page 36: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/36.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Query methods
![Page 37: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/37.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
• Secondary Index querying using N1QL
• View Index querying
• Spatial View Index querying
Querying in Couchbase
![Page 38: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/38.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
• N1QL – SQL like query language for JSON
• Secondary Index supports global indexes across the cluster
• Mutlidimensional scaling - Separate index and query service
Secondary Index querying with N1QL
![Page 39: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/39.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Secondary Index querying with N1QL
![Page 40: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/40.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Secondary Index querying with N1QL
![Page 41: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/41.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
• Built into the data service
• User defined MapReduce Javascript functions to index and filter results
• Uses scatter-gather approach to get results in a multi-node cluster
View Index querying
![Page 42: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/42.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
View Index querying
![Page 43: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/43.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
View Index querying
![Page 44: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/44.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
• Similar to Views with just Map function, built on R Tree
• Index on GeoJson objects as well as other JSON properties
• Open and closed range queries supporting the N-dimensions indexed
Spatial View Index querying
![Page 45: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/45.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spatial View Index querying
![Page 46: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/46.jpg)
©2016 Couchbase Inc.
Production-Ready Microservice
![Page 47: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/47.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Production-ready microservice’s cross-cutting concerns
• Reliability
• Discoverability
• Observability
• Configurability
• Securability
• Auditability
Building a Production-ready Microservice
![Page 48: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/48.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Production-ready microservice’s cross-cutting concerns
• Reliability
• Discoverability
• Observability
• Configurability
• Securability
• Auditability
Building a Production-ready Microservice
Spring Boot & Cloud
![Page 49: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/49.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Reliability: Netflix Hystrix
![Page 50: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/50.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Discoverability: Netflix Eureka
![Page 51: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/51.jpg)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Observability: Boot Actuator
![Page 52: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/52.jpg)
©2016 Couchbase Inc.
Demo
![Page 53: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/53.jpg)
©2016 Couchbase Inc.
Thank You!
![Page 54: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016](https://reader033.fdocuments.in/reader033/viewer/2022052419/5874f6201a28ab917a8b7edd/html5/thumbnails/54.jpg)
©2016 Couchbase Inc. 54
Share your opinion on Couchbase
1. Go here: http://gtnr.it/2eRxYWn
2. Create a profile
3. Provide feedback (~15
minutes)