SlideShare a Scribd company logo
Centralized Application Configuration 
with Spring and Apache ZooKeeper 
By Ryan Gardner, Dealer.com 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
How do you configure your applications? 
2 
http://b.socrative.com/login/student/ 
config2gx
Who is Dealer.com? 
We make software that car dealers use 
to fulfill their digital marketing vision. 
3
The Remote Configuration Project 
4
Some ways we had configured our applications 
• Hardcoded values in code 
• Properties file – per environment or merged 
• Host files for database 
• JNDI context files 
5
Motivating factors 
• Developer Efficiency 
• Redeploying an application just to change a configuration is a drag 
• Having to edit N config files whenever a single application changed is a 
hassle 
• Security Compliance 
• Limit access to production databases 
• Auditing and approval process for configuration changes 
• Systems Engineering 
• Can’t make certain changes without involving developers 
6
Framework Development – Guns n Roses style 
"Welcome to the jungle" 
Thanks. 
"We've got fun and games" 
Cool. 
"You're in the jungle" 
We've established this 
"You're gonna die!" 
Wait what? 
https://twitter.com/OhNoSheTwitnt/status/469838190141255680 
7
High Level Overview 
8
Three main components 
9
10
Key Concepts in the Remote Configuration 
Configuration 
A set of properties or values necessary to create an object. 
Examples: 
Database configuration, FTP endpoint configuration, 
HTTP Proxy Factory Bean Configuration, 
11
Tripoli – editing a configuration 
12
Separation of environments 
• We edit our configurations in one spot, but applications are only 
able to retrieve configurations for the environment they are 
running in 
• Secrets – such as passwords or encryption keys – are encrypted 
with an environment-specific key 
• Tripoli has all the keys, each environment will only have a key specific to it 
13
Configuration inheritance – avoiding copy & paste 
By Environment 
• Configuration can be set at a global level 
and overridden at each environment 
By Path 
• Nodes added with /’s in the name will inherit data from nodes 
above them. 
• /remoting/core-services/UserLocator inherits values from 
/remoting/core-services 
14
Key Concepts in the Remote Configuration 
Bindings 
Identifying which configurations an application uses, and what 
the application wants to call them 
Example: An application that needs to talk to a certain database, look up users 
from a remote service, and send data to a remote SFTP site would have bindings 
such as: 
jdbc/user-database is bound to the configuration called user-database-config 
15
Tripoli – editing bindings 
16
Creating objects, not properties* 
• Configure once – use everywhere 
• Avoid having to copy-and-paste boilerplate setup code 
* properties are supported too 
17
Behind the Scenes 
18
Apache Zookeeper 
• Hierarchical data registers 
• Designed for high-throughput, low-latency, highly-available 
• Nodes in zookeeper are called “znodes” 
• Each path can stored data 
• Designed for storing small amounts of data in the znodes 
(KB, not MB) 
• For more info: 
• https://cwiki.apache.org/confluence/display/ZOOKEEPER/ProjectDescriptio 
n 
19
Where do we store this data? 
20 
• Versioned configuration in ZooKeeper as JSON 
• In ZooKeeper znodes: 
• /bindings/<binding name> 
overrides: 
• /bindings/<habitat>/<datacenter>/<binding name> 
• /configurations/<configuration name>/
Talking to ZooKeeper 
• Use Curator framework 
• We use ACLs in ZooKeeper ensure apps can’t read data for 
other environments 
• We use a SASL config file on the machines to provide the 
ZooKeeper credentials 
21
Exhibitor – makes managing ZooKeeper easier 
22
How do the objects get created? 
• Two classes for each remotely-configurable object, 
the config and the creator 
• Configs use bean-validation annotations and a special annotation 
on the config-field to explain what the config field does. 
• This populates the tool-tips in the browser window and is used to ensure 
that only valid entries are put into the fields 
23
An example config class 
24 
@ConfigCategory("ftp”) 
public class SpringIntegrationSftpSessionFactoryConfig extends Config { 
@Required 
@ConfigField(description = "The host name of the SFTP server.”) 
private String host; 
@Port 
@ConfigField(description = "The port of the SFTP server. Defaults to 22.”) 
private Integer port; 
…
A config class (continued) 
25 
@Required 
@Password 
@ConfigField(description = "The private key used to establish the SFTP 
connection.”) 
private ConfigPassword privateKey; 
@Password 
@ConfigField(description = "The passphrase for the private key. Defaults to 
empty string.”) 
private ConfigPassword privateKeyPassphrase;
Creators take the config and return an object 
26 
public class ExampleObjectCreator extends 
ObjectCreator<SomeConfig,ExampleObject> { 
@Override 
public ExampleObject create(SomeConfig) { 
// do whatever is needed to create the object 
return new ExampleObject(); 
} 
}
Kinds of creators we have made 
• Database connection (various connection pools) 
• Mongo connection pools 
• RPC remoting proxies (Spring HTTP Invoker, etc) 
• REST resources 
• Redis connections 
• Properties / System properties 
• FTP and SFTP connections 
• Executor services 
• RabbitMQ 
• SOLR 
• ElasticSearch 
• … more 
27
How do apps use this? 
28
First pass – XML namespace parser 
29 
<beans … xmlns:remote-config=“http://www.dealer.com/schema/remote-config” 
…> 
<remote-config:lookup id="dataSource" name=”jdbc/my-datasource" /> 
<remote-config:remote-config-property-source id="myProps" 
name="properties/my-props" /> 
</beans>
Second pass – Auto-config with XML 
30 
<beans … xmlns:remote-config=“http://www.dealer.com/schema/remote-config” 
…> 
… 
<remote-config:auto-create /> 
… 
</beans>
Third pass - @EnableRemoteConfig 
31 
@EnableRemoteConfig 
public class ApplicationConfig { 
// insert tweetable app here. 
}
Accessing properties 
32
Integrating remote properties into spring 
• We create a PropertySource 
• And we create a PropertySourcesPlaceholderConfigurer 
33
Using properties via @Value 
34 
@Bean 
public SomeBean someBean (@Value(“${some.value}”) someValue) { 
return new SomeBean(someValue) 
} 
… 
@Value(“${some.remote.property.value}”) 
private String someValue;
Deeper dive – demo & 
look at some of the code 
35
Future plans & extensions for this 
36
Questions? 
37
38 
Learn More. Stay Connected 
Tweet: “#s2gx talk about zookeeper blew my mind! 
Thanks @ryebrye and @springcentral” 
@springcentral | spring.io/video
Ad

More Related Content

What's hot (20)

Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introduce
jhao niu
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016
Viet-Dung TRINH
 
ZooKeeper - wait free protocol for coordinating processes
ZooKeeper - wait free protocol for coordinating processesZooKeeper - wait free protocol for coordinating processes
ZooKeeper - wait free protocol for coordinating processes
Julia Proskurnia
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
Saurav Haloi
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
How to Run Solr on Docker and Why
How to Run Solr on Docker and WhyHow to Run Solr on Docker and Why
How to Run Solr on Docker and Why
Sematext Group, Inc.
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
Łukasz Proszek
 
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on DockerRunning High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Sematext Group, Inc.
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
Omid Vahdaty
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
Jimmy Lai
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
Samantha Quiñones
 
Apache Zookeeper
Apache ZookeeperApache Zookeeper
Apache Zookeeper
Nguyen Quang
 
Setup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands OnSetup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands On
hkbhadraa
 
Experiences from Running Masterless Puppet - PuppetConf 2014
Experiences from Running Masterless Puppet - PuppetConf 2014Experiences from Running Masterless Puppet - PuppetConf 2014
Experiences from Running Masterless Puppet - PuppetConf 2014
Puppet
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStack
Matt Ray
 
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
 
Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introduce
jhao niu
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016
Viet-Dung TRINH
 
ZooKeeper - wait free protocol for coordinating processes
ZooKeeper - wait free protocol for coordinating processesZooKeeper - wait free protocol for coordinating processes
ZooKeeper - wait free protocol for coordinating processes
Julia Proskurnia
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법[오픈소스컨설팅] EFK Stack 소개와 설치 방법
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
Saurav Haloi
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
Łukasz Proszek
 
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on DockerRunning High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Sematext Group, Inc.
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
Omid Vahdaty
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
Jimmy Lai
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
Samantha Quiñones
 
Setup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands OnSetup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands On
hkbhadraa
 
Experiences from Running Masterless Puppet - PuppetConf 2014
Experiences from Running Masterless Puppet - PuppetConf 2014Experiences from Running Masterless Puppet - PuppetConf 2014
Experiences from Running Masterless Puppet - PuppetConf 2014
Puppet
 
Australian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStackAustralian OpenStack User Group August 2012: Chef for OpenStack
Australian OpenStack User Group August 2012: Chef for OpenStack
Matt Ray
 
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet
 
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka ClusterDeveloping distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
 

Viewers also liked (18)

Dynamic Reconfiguration of Apache ZooKeeper
Dynamic Reconfiguration of Apache ZooKeeperDynamic Reconfiguration of Apache ZooKeeper
Dynamic Reconfiguration of Apache ZooKeeper
DataWorks Summit
 
Resource Handling in Spring MVC 4.1
Resource Handling in Spring MVC 4.1Resource Handling in Spring MVC 4.1
Resource Handling in Spring MVC 4.1
Rossen Stoyanchev
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)
Jyrki Pulliainen
 
Distributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperDistributed Applications with Apache Zookeeper
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
Comparing ZooKeeper and Consul
Comparing ZooKeeper and ConsulComparing ZooKeeper and Consul
Comparing ZooKeeper and Consul
Ivan Glushkov
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
Scott Leberknight
 
Spring Boot with Quartz
Spring Boot with QuartzSpring Boot with Quartz
Spring Boot with Quartz
David Kiss
 
Taming Pythons with ZooKeeper
Taming Pythons with ZooKeeperTaming Pythons with ZooKeeper
Taming Pythons with ZooKeeper
Jyrki Pulliainen
 
ZooKeeper Futures
ZooKeeper FuturesZooKeeper Futures
ZooKeeper Futures
Cloudera, Inc.
 
ZooKeeper (and other things)
ZooKeeper (and other things)ZooKeeper (and other things)
ZooKeeper (and other things)
Jonathan Halterman
 
Zookeeper
ZookeeperZookeeper
Zookeeper
ltsllc
 
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
lisanl
 
Getting Started with Spring Boot
Getting Started with Spring BootGetting Started with Spring Boot
Getting Started with Spring Boot
David Kiss
 
Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)
Chris Richardson
 
Jcconf 2016 zookeeper
Jcconf 2016 zookeeperJcconf 2016 zookeeper
Jcconf 2016 zookeeper
Matt Ho
 
Zookeeper
ZookeeperZookeeper
Zookeeper
Geng-Dian Huang
 
Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架
Cabin WJ
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
Dynamic Reconfiguration of Apache ZooKeeper
Dynamic Reconfiguration of Apache ZooKeeperDynamic Reconfiguration of Apache ZooKeeper
Dynamic Reconfiguration of Apache ZooKeeper
DataWorks Summit
 
Resource Handling in Spring MVC 4.1
Resource Handling in Spring MVC 4.1Resource Handling in Spring MVC 4.1
Resource Handling in Spring MVC 4.1
Rossen Stoyanchev
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)
Jyrki Pulliainen
 
Distributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperDistributed Applications with Apache Zookeeper
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
Comparing ZooKeeper and Consul
Comparing ZooKeeper and ConsulComparing ZooKeeper and Consul
Comparing ZooKeeper and Consul
Ivan Glushkov
 
Spring Boot with Quartz
Spring Boot with QuartzSpring Boot with Quartz
Spring Boot with Quartz
David Kiss
 
Taming Pythons with ZooKeeper
Taming Pythons with ZooKeeperTaming Pythons with ZooKeeper
Taming Pythons with ZooKeeper
Jyrki Pulliainen
 
Zookeeper
ZookeeperZookeeper
Zookeeper
ltsllc
 
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
ZooKeeper and Embedded ZooKeeper Support for IBM InfoSphere Streams V4.0
lisanl
 
Getting Started with Spring Boot
Getting Started with Spring BootGetting Started with Spring Boot
Getting Started with Spring Boot
David Kiss
 
Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)Overview of Zookeeper, Helix and Kafka (Oakjug)
Overview of Zookeeper, Helix and Kafka (Oakjug)
Chris Richardson
 
Jcconf 2016 zookeeper
Jcconf 2016 zookeeperJcconf 2016 zookeeper
Jcconf 2016 zookeeper
Matt Ho
 
Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架Apache Zookeeper 分布式服务框架
Apache Zookeeper 分布式服务框架
Cabin WJ
 
Ad

Similar to Centralized Application Configuration with Spring and Apache Zookeeper (20)

Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
David Stein
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
Uri Cohen
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
MongoDB
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
Introduction to firebidSQL 3.x
Introduction to firebidSQL 3.xIntroduction to firebidSQL 3.x
Introduction to firebidSQL 3.x
Fabio Codebue
 
Aai 3228-dev ops-tools-websphere-sl
Aai 3228-dev ops-tools-websphere-slAai 3228-dev ops-tools-websphere-sl
Aai 3228-dev ops-tools-websphere-sl
sflynn073
 
Orchestrating Cloud Applications With TOSCA
Orchestrating Cloud Applications With TOSCAOrchestrating Cloud Applications With TOSCA
Orchestrating Cloud Applications With TOSCA
Arthur Berezin
 
What’s new in WSO2 Enterprise Integrator 6.6
What’s new in WSO2 Enterprise Integrator 6.6What’s new in WSO2 Enterprise Integrator 6.6
What’s new in WSO2 Enterprise Integrator 6.6
WSO2
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
Hojoong Kim
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Cloud Native Day Tel Aviv
 
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UKSitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Jitendra Soni
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
Jakub Hajek
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys Serdiuk
Lohika_Odessa_TechTalks
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
WASdev Community
 
Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
Docker, Inc.
 
Operational Visibiliy and Analytics - BU Seminar
Operational Visibiliy and Analytics - BU SeminarOperational Visibiliy and Analytics - BU Seminar
Operational Visibiliy and Analytics - BU Seminar
Canturk Isci
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
clairvoyantllc
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
Ortus Solutions, Corp
 
TechBeats #2
TechBeats #2TechBeats #2
TechBeats #2
applausepoland
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
David Stein
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
Uri Cohen
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
MongoDB
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
Introduction to firebidSQL 3.x
Introduction to firebidSQL 3.xIntroduction to firebidSQL 3.x
Introduction to firebidSQL 3.x
Fabio Codebue
 
Aai 3228-dev ops-tools-websphere-sl
Aai 3228-dev ops-tools-websphere-slAai 3228-dev ops-tools-websphere-sl
Aai 3228-dev ops-tools-websphere-sl
sflynn073
 
Orchestrating Cloud Applications With TOSCA
Orchestrating Cloud Applications With TOSCAOrchestrating Cloud Applications With TOSCA
Orchestrating Cloud Applications With TOSCA
Arthur Berezin
 
What’s new in WSO2 Enterprise Integrator 6.6
What’s new in WSO2 Enterprise Integrator 6.6What’s new in WSO2 Enterprise Integrator 6.6
What’s new in WSO2 Enterprise Integrator 6.6
WSO2
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
Hojoong Kim
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Cloud Native Day Tel Aviv
 
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UKSitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Jitendra Soni
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
Jakub Hajek
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys Serdiuk
Lohika_Odessa_TechTalks
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
WASdev Community
 
Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
Docker, Inc.
 
Operational Visibiliy and Analytics - BU Seminar
Operational Visibiliy and Analytics - BU SeminarOperational Visibiliy and Analytics - BU Seminar
Operational Visibiliy and Analytics - BU Seminar
Canturk Isci
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
clairvoyantllc
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
 
Ad

Recently uploaded (20)

Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 

Centralized Application Configuration with Spring and Apache Zookeeper

  • 1. Centralized Application Configuration with Spring and Apache ZooKeeper By Ryan Gardner, Dealer.com © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 2. How do you configure your applications? 2 http://b.socrative.com/login/student/ config2gx
  • 3. Who is Dealer.com? We make software that car dealers use to fulfill their digital marketing vision. 3
  • 5. Some ways we had configured our applications • Hardcoded values in code • Properties file – per environment or merged • Host files for database • JNDI context files 5
  • 6. Motivating factors • Developer Efficiency • Redeploying an application just to change a configuration is a drag • Having to edit N config files whenever a single application changed is a hassle • Security Compliance • Limit access to production databases • Auditing and approval process for configuration changes • Systems Engineering • Can’t make certain changes without involving developers 6
  • 7. Framework Development – Guns n Roses style "Welcome to the jungle" Thanks. "We've got fun and games" Cool. "You're in the jungle" We've established this "You're gonna die!" Wait what? https://twitter.com/OhNoSheTwitnt/status/469838190141255680 7
  • 10. 10
  • 11. Key Concepts in the Remote Configuration Configuration A set of properties or values necessary to create an object. Examples: Database configuration, FTP endpoint configuration, HTTP Proxy Factory Bean Configuration, 11
  • 12. Tripoli – editing a configuration 12
  • 13. Separation of environments • We edit our configurations in one spot, but applications are only able to retrieve configurations for the environment they are running in • Secrets – such as passwords or encryption keys – are encrypted with an environment-specific key • Tripoli has all the keys, each environment will only have a key specific to it 13
  • 14. Configuration inheritance – avoiding copy & paste By Environment • Configuration can be set at a global level and overridden at each environment By Path • Nodes added with /’s in the name will inherit data from nodes above them. • /remoting/core-services/UserLocator inherits values from /remoting/core-services 14
  • 15. Key Concepts in the Remote Configuration Bindings Identifying which configurations an application uses, and what the application wants to call them Example: An application that needs to talk to a certain database, look up users from a remote service, and send data to a remote SFTP site would have bindings such as: jdbc/user-database is bound to the configuration called user-database-config 15
  • 16. Tripoli – editing bindings 16
  • 17. Creating objects, not properties* • Configure once – use everywhere • Avoid having to copy-and-paste boilerplate setup code * properties are supported too 17
  • 19. Apache Zookeeper • Hierarchical data registers • Designed for high-throughput, low-latency, highly-available • Nodes in zookeeper are called “znodes” • Each path can stored data • Designed for storing small amounts of data in the znodes (KB, not MB) • For more info: • https://cwiki.apache.org/confluence/display/ZOOKEEPER/ProjectDescriptio n 19
  • 20. Where do we store this data? 20 • Versioned configuration in ZooKeeper as JSON • In ZooKeeper znodes: • /bindings/<binding name> overrides: • /bindings/<habitat>/<datacenter>/<binding name> • /configurations/<configuration name>/
  • 21. Talking to ZooKeeper • Use Curator framework • We use ACLs in ZooKeeper ensure apps can’t read data for other environments • We use a SASL config file on the machines to provide the ZooKeeper credentials 21
  • 22. Exhibitor – makes managing ZooKeeper easier 22
  • 23. How do the objects get created? • Two classes for each remotely-configurable object, the config and the creator • Configs use bean-validation annotations and a special annotation on the config-field to explain what the config field does. • This populates the tool-tips in the browser window and is used to ensure that only valid entries are put into the fields 23
  • 24. An example config class 24 @ConfigCategory("ftp”) public class SpringIntegrationSftpSessionFactoryConfig extends Config { @Required @ConfigField(description = "The host name of the SFTP server.”) private String host; @Port @ConfigField(description = "The port of the SFTP server. Defaults to 22.”) private Integer port; …
  • 25. A config class (continued) 25 @Required @Password @ConfigField(description = "The private key used to establish the SFTP connection.”) private ConfigPassword privateKey; @Password @ConfigField(description = "The passphrase for the private key. Defaults to empty string.”) private ConfigPassword privateKeyPassphrase;
  • 26. Creators take the config and return an object 26 public class ExampleObjectCreator extends ObjectCreator<SomeConfig,ExampleObject> { @Override public ExampleObject create(SomeConfig) { // do whatever is needed to create the object return new ExampleObject(); } }
  • 27. Kinds of creators we have made • Database connection (various connection pools) • Mongo connection pools • RPC remoting proxies (Spring HTTP Invoker, etc) • REST resources • Redis connections • Properties / System properties • FTP and SFTP connections • Executor services • RabbitMQ • SOLR • ElasticSearch • … more 27
  • 28. How do apps use this? 28
  • 29. First pass – XML namespace parser 29 <beans … xmlns:remote-config=“http://www.dealer.com/schema/remote-config” …> <remote-config:lookup id="dataSource" name=”jdbc/my-datasource" /> <remote-config:remote-config-property-source id="myProps" name="properties/my-props" /> </beans>
  • 30. Second pass – Auto-config with XML 30 <beans … xmlns:remote-config=“http://www.dealer.com/schema/remote-config” …> … <remote-config:auto-create /> … </beans>
  • 31. Third pass - @EnableRemoteConfig 31 @EnableRemoteConfig public class ApplicationConfig { // insert tweetable app here. }
  • 33. Integrating remote properties into spring • We create a PropertySource • And we create a PropertySourcesPlaceholderConfigurer 33
  • 34. Using properties via @Value 34 @Bean public SomeBean someBean (@Value(“${some.value}”) someValue) { return new SomeBean(someValue) } … @Value(“${some.remote.property.value}”) private String someValue;
  • 35. Deeper dive – demo & look at some of the code 35
  • 36. Future plans & extensions for this 36
  • 38. 38 Learn More. Stay Connected Tweet: “#s2gx talk about zookeeper blew my mind! Thanks @ryebrye and @springcentral” @springcentral | spring.io/video

Editor's Notes

  • #4: Websites Advertising Inventory management Analytics CRM (and more)
  • #5: There is a slide shown at the keynotes -
  • #8: There are often surprises as you develop things – you think you are on the right path but then… wooops.
  • #18: How many people have ever started a project, realized they needed a certain data source – so they went to another project that they had opened and then copied the configuration out of it and pasted it into the new one.
  • #21: Apache Zookeeper. Good project. Horible logo. “ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. “
  • #31: Simplify cruft – eliminate duplicate entry… but… still XML
  • #32: We can now create tweetable apps that run in any of our environments and use the proper datasources or service endpoints for that environment.
  • #34: Transparently use @Value annotated properties in your classes.
  • #36: Look at property sources configurer. Point out bean definitions vs beans. Look at a creator or two.