54
©2016 Couchbase Inc. 1 The Couchbase Connect16 mobile app Take our in-app survey!

Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

Embed Size (px)

Citation preview

Page 1: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.

Bootiful Couchbase: Microservices with Spring

Page 3: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Simon BasléSoftware Engineer, Pivotal

[email protected]

Page 4: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Subhashni BalakrishnanSDK Engineer, Couchbase

[email protected]

Page 5: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Why Microservices?

Page 7: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Spring PlatformSpring Boot, Spring Cloud and Spring Data

Page 8: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

From framework to platform

Spring Framework

Page 9: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Framework Ecosystem

From framework to platform

Page 10: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Boot

From framework to platform

Page 11: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Boot

externalized configuration management

Page 14: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Boot

auto-configuration

Page 16: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Boot

monitoring & configuration via actuator

Page 18: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Cloud

Circuit Breaker(Hystrix...)

Page 20: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Cloud

Distributed Configuration

Page 21: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Cloud

Service Discovery(Eureka, Consul...)

Page 22: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Cloud

Load Balancing & MicroProxies(Zuul...)

Page 23: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Cloud

Distributed Tracing(Sleuth, Zipkin...)

Page 24: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Data

Repository abstractionfor CRUD

Page 26: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring Data

Template abstractionfor lower level interactions

Page 27: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©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

©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

©2016 Couchbase Inc.

Demo

Page 31: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Spring Data CouchbaseOverview

Page 32: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spring & Couchbase

JSON JSON

Page 33: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Repository Pattern & Spring Data

Page 35: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Repository Query methods

Page 36: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Repository Query methods

Page 37: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Secondary Index querying with N1QL

Page 40: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Secondary Index querying with N1QL

Page 41: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

View Index querying

Page 43: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

View Index querying

Page 44: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Spatial View Index querying

Page 46: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Production-Ready Microservice

Page 47: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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

©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

©2016 Couchbase Inc.©2016 Couchbase Inc.

Reliability: Netflix Hystrix

Page 50: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Discoverability: Netflix Eureka

Page 51: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.©2016 Couchbase Inc.

Observability: Boot Actuator

Page 52: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Demo

Page 53: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©2016 Couchbase Inc.

Thank You!

Page 54: Pivotal: Bootiful Couchbase: microservices with Spring – Couchbase Connect 2016

©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)