Upload
couchbase
View
366
Download
2
Embed Size (px)
Citation preview
©2016 Couchbase Inc. 1
The Couchbase Connect16 mobile app
Take our in-app survey!
©2016 Couchbase Inc.
Bootiful Couchbase: Microservices with Spring
©2016 Couchbase Inc.
Simon BasléSoftware Engineer, Pivotal
©2016 Couchbase Inc.
Subhashni BalakrishnanSDK Engineer, Couchbase
©2016 Couchbase Inc.
Agenda
• Briefly introduce Microservices
• Spring Ecosystem
• Couchbase with Spring Data
• Addressing production-ready concerns when building Microservices
©2016 Couchbase Inc.©2016 Couchbase Inc.
Why Microservices?
©2016 Couchbase Inc.
Spring PlatformSpring Boot, Spring Cloud and Spring Data
©2016 Couchbase Inc.©2016 Couchbase Inc.
From framework to platform
Spring Framework
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Framework Ecosystem
From framework to platform
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
From framework to platform
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Bootthe opinionated glue that ties all that together
From framework to platform
©2016 Couchbase Inc.©2016 Couchbase Inc.
integration of various projects via starters
Spring Boot
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
externalized configuration management
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
externalized configuration management
CLI > … > JNDI > system properties > OS env > … > .properties outside jar > .properties inside jar …
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
auto-configuration
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
auto-configuration(not a mystic art)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Boot
monitoring & configuration via actuator
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
use Spring Cloud in Bootfor resiliency and production gradeness
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Circuit Breaker(Hystrix...)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Distributed Configuration
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Service Discovery(Eureka, Consul...)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Load Balancing & MicroProxies(Zuul...)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Cloud
Distributed Tracing(Sleuth, Zipkin...)
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
use Spring Data in Bootfor data access
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
Repository abstractionfor CRUD
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
Template abstractionfor lower level interactions
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring Data
Query Derivation in repositoriesfor easy querying
©2016 Couchbase Inc.©2016 Couchbase Inc.
And Much More
A lot of other aspects to integrate in Boot
©2016 Couchbase Inc.©2016 Couchbase Inc.
And Much More
A lot of other aspects to integrate in Bootmessaging, session, security, auditing, templating, social ...
©2016 Couchbase Inc.
Demo
©2016 Couchbase Inc.
Spring Data CouchbaseOverview
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spring & Couchbase
JSON JSON
©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
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Pattern & Spring Data
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Query methods
©2016 Couchbase Inc.©2016 Couchbase Inc.
Repository Query methods
©2016 Couchbase Inc.©2016 Couchbase Inc.
• Secondary Index querying using N1QL
• View Index querying
• Spatial View Index querying
Querying in Couchbase
©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
©2016 Couchbase Inc.©2016 Couchbase Inc.
Secondary Index querying with N1QL
©2016 Couchbase Inc.©2016 Couchbase Inc.
Secondary Index querying with N1QL
©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
©2016 Couchbase Inc.©2016 Couchbase Inc.
View Index querying
©2016 Couchbase Inc.©2016 Couchbase Inc.
View Index querying
©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
©2016 Couchbase Inc.©2016 Couchbase Inc.
Spatial View Index querying
©2016 Couchbase Inc.
Production-Ready Microservice
©2016 Couchbase Inc.©2016 Couchbase Inc.
Production-ready microservice’s cross-cutting concerns
• Reliability
• Discoverability
• Observability
• Configurability
• Securability
• Auditability
Building a Production-ready Microservice
©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
©2016 Couchbase Inc.©2016 Couchbase Inc.
Reliability: Netflix Hystrix
©2016 Couchbase Inc.©2016 Couchbase Inc.
Discoverability: Netflix Eureka
©2016 Couchbase Inc.©2016 Couchbase Inc.
Observability: Boot Actuator
©2016 Couchbase Inc.
Demo
©2016 Couchbase Inc.
Thank You!
©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)