26
SPRING CLOUD * Discovery and Configuration Systems Comparison Spencer Gibb @spencerbgibb https://github.com/spencergibb/spring-cloud-star

2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

  • Upload
    others

  • View
    19

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

SPRING CLOUD *Discovery and Configuration

Systems ComparisonSpencer Gibb @spencerbgibb

https://github.com/spencergibb/spring-cloud-star

Page 2: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Salt Lake City, Utah

Page 3: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Page 4: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Spring Cloud Roadmap

• Brixton GA ReleaseD: 11 May 2016

• ‘Camden’ will follow Spring Boot 1.4: Q3 2016

• ‘Dalston’ will follow Spring 5 & Spring Boot 2.0: Q2 2017 (Java 8)

• Many Services Releases (SR) in between

Page 5: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Microservices

You must be this tall to ride

Page 6: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Service B

Service Registration & Discovery

Registry

Service A

Page 7: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

DiscoveryClient

• @EnableDiscoveryClient

• ServiceInstance si = discoveryClient.choose(“serviceId”)

• RestTemplate

• @FeignClient

Page 8: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Service B

12 Factor Apps http://12factor.net

Distributed Configuration

Config

Service A

Page 9: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Service A

Context Lifecycle

BootstrapApplication

Context

Regular Application

Context

Config Server

Page 10: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Environment

• @ConfigurationProperties

• @Value

• Environment

Page 11: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Spring Cloud Config Server

• Greenfield

• HTTP API similar to Netflix Config Server

• Backed by VCS: git, SVN

• Stateless

• @RefreshScope

• Plain text files (eg. messages_fr.properties)

Page 12: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Spring Cloud Config Server

• Uses spring-boot configuration files & semantics

• Auto-configured client

• Refresh via bus (events)

• Webhook support for github, gitlab and bitbucket

• Commercial Support in Pivotal Cloud Foundry

Page 13: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

DEMO

Page 14: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Eureka

Page 15: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

💚

Eureka pro’s

• Highly-available

• Mature / Proven by Netflix

• Tight Ribbon Integration

• Commercial Support in Pivotal Cloud Foundry

Page 16: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Eureka Cons

• JVM Based

• Thick Java client

• Polyglot by Sidecar

• Built for AWS Initially

• Long thresholds for registraion and cache refresh (30s)

💔

Page 17: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Consul

Page 18: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Consul pros

•Service Discovery & Configuration

•Polyglot

•HTTP API and DNS interface

•ACL’s

•Health Checks

💚

Page 19: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

💚

Consul pros

• Multi-Datacenter

• Vault Integration (Keys and Secrets)

• YAML and Properties Blobs supported

• peer-to-peer gossip system

• Nice UI

Page 20: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Consul cons•Young

•Agent on every host

💔

Page 21: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

DEMO

Page 22: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Zookeeper

Page 23: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

💚

Zookeeper pros

• Consistent Store

• Started life as a Hadoop sub-project (2007?)

• Mature, used in many companies

• Useful if ZK is already part of your infrastructure

• Ephemeral Nodes / Persistent Connections

• Uses Apache Curator’s Service Discovery Recipe

Page 24: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

💔

Zookeeper cons

•Scale Issues

•OPS Headaches

•Needs management process like Netflix Exhibitor

•Persistent Connections

Page 25: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Honorable Mention• HAProxy/Nginx/Apache HTTPD

• Spring Cloud CloudFoundry

• Spring Cloud ETCD (Experimental)

• AirbNB Smart Stackhttp://nerds.airbnb.com/smartstack-service-discovery-cloud/

• Uber HyperbahNhttps://youtu.be/N2472uS5Y6Mhttps://github.com/uber/hyperbahn

Page 26: 2016-05-18 Spring Cloud Discovery and Config Sys Comparison Spring... · Spring I/O 2016 Spring Cloud Roadmap • Brixton GA ReleaseD: 11 May 2016 • ‘Camden’ will follow Spring

Spring I/O 2016

Questions?

Me: Workshop: Cloud Native Apps with Spring Cloud & Netflix OSS

16:30-18:20 Room 2

https://github.com/spencergibb/spring-cloud-star

http://spencer.gibb.us @spencerbgibb