SlideShare a Scribd company logo
Remote Con g
REST API and Versioning
shibuya.apk #24
@red_fat_daruma
Agenda
What's Remote Con g?
How do we use Remote Con g?
What can we do by using REST API?
About Remocon
Remote Con g
Firebase family
Change your app's behavior
and view w/o distributing an
update
Completely free for now
Uses
Seasonal stuff which don't depend on device time
e.g. promotions, component control etc.
A/B testing
User segment-based value distributions
Of cial Client Libraries
For Android, iOS, Web app
Consist of 3 features
Fetch con gs and cache them
Set default values for missing keys
Return an associated value with a key
i.e. kinda GET-only KVS client w/ cache system
Overview of Client
Default & Fetched
Con g are sources
for Active Con g
ref: https:// rebase.google.com/docs/remote-con g/api-overview
Client libraries kindly handle
troublesome problems!
e.g. data consistensy, cache etc.
But they are just readers...
Cannot be used for Remote Con g management
So far
If you wanna update...
Only web UI editor is available
You need to click PUBLISH CHANGES after editing
Web UI looks rich! but...
No validations for values
If you wanna use JSON value, that's horrible
Cannot update automatically
Publishers might forget to click PUBLISH CHANGES (I
often do that)
Diffs are not visible
Who updated? What was changed?
Not friendly for non-developers
In addition, don't want them to open projects...
2018/03/13
Announcing the Remote
Con g REST API
https://goo.gl/twVB6w
Remote Config REST API and Versioning
Remote Con g REST API
Like single JSON object store and/or Firestore
Not key-based management interface
Get
Fetch con gs from the server as a json le
Update
Put a json le to update con gs on the server
ref: https:// rebase.google.com/docs/remote-con g/use-con g-rest
Authentication
Access token approach
1. Download a service account key of the project
2. Publish an access token (which has a time limit)
by using Google API Client
1. Download a key
SERVICE ACCOUNTS tab in your project setting
Publish an access token
For example, this is for python2.
% sudo easy_install oauth2client
% YOUR_EDITOR publish_access_token.py
API Spec
Endpoint
https:// rebaseremotecon g.googleapis.com/v1/projects/${your_p
roject_id}/remoteCon g
Supported methods
GET
PUT (w/ a le upload)
Accept-Encoding: deflate, gzip is required
If missing, Etag is not included
GET con gs
The of cial sample is based on curl
curl --compressed 
-D headers 
-H "Authorization: Bearer $token" 
-X GET 
"$ENDPOINT" 
-o "$output_file_path"
# --compressed is required to see etag
PUT con gs
curl --compressed -i 
-H "Content-Type: application/json; UTF8" 
-H "If-Match: last-returned-etag" 
-H "Authorization: Bearer $token" 
-X PUT 
"$ENDPOINT" 
-d @filename_of_config_json
# --compressed is required if you wanna see etag
Web UI looks rich! but... (again)
No validations for values
If you wanna use JSON value, that's horrible
Cannot update automatically
Publishers might forget to click PUBLISH CHANGES (I
often do that)
Diffs are not visible
Who updated? What was changed?
Not friendly for non-developers
In addition, don't want them to open projects...
What we can do w/ REST API
Value validations by your code
Nested json is not allowed so json validator is
still required
Update automatically by your code
PUT API publishes changes immediately
Diffs would be visible on your VCS
Non-developers can change con gs safely w/o
rebase permission by your code
Btw, are diffs readable
between jsons?
The answer is NO
Okay, I'll do it by myself...
so where is a sdk?
THERE IS NO SDK
Remocon
Ruby Gem - https://github.com/jmatsu/remocon
YAML-based RemoteCon g manager
Additional features
Validation system
File content load
How to use
1. Install remocon
2. Prepare an access token
3. export the following variables
FIREBASE_PROJECT_ID
REMOTE_CONFIG_ACCESS_TOKEN
4. Run commands!
Get con gs
remocon pull --dest=${output_dir}`
Create 4 les
con g.json : raw.json on the server
etag : etag
conditions.yml : condition de nitions
parameters.yml : parameter de nitions
Get con gs
remocon pull --dest=${output_dir}`
Create 4 les
con g.json : raw json on the server
etag : etag
conditions.yml : condition de nitions
parameters.yml : parameter de nitions
Only parameters.yml is what you will update
Update con gs
Create a json le to be uploaded
Of course, validations run in this section
remocon create 
--conditions="/path/to/conditions.yml" 
--parameters="/path/to/parameters.yml"`
And then, push it to the server
remocon push 
--source="/path/to/config.json" 
--etag="/path/to/etag"
Validation
Just run the following command
remocon validation 
--conditions="/path/to/conditions.yml" 
--parameters="/path/to/parameters.yml"`
Format of parameters.yml
How does it work on CI?
On feature branch
Just validate
On master
Load a service account json
Publish an access token
Just push your les
So it's like terraform's plan and apply
ref: http://tech.mercari.com/entry/2018/04/09/110000
Future work
Diff-based update
A prototype already worked on my local...
More readable diff command
Plugin system for validators
Fix a bug which was found while creating these
slides
Make it stable... and 1.0.0 release
Appendix1
Can we start with a blank remote con g?
Yes. But you need to get the initial Etag by
calling GET api.
Can we update con gs regularly or speci c time?
Partially yes. Firebase doesn't have such
features, so we need to use a time-based job
scheduler like cron.
Can we create conditions by API?
No. You need to create them from the console.
Appendix2
Best practice for fetching Remote Con g
https://goo.gl/Uw5nzq
If you know how to build expressions of
conditions, please let me know...!!!
Ad

More Related Content

What's hot (20)

Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros DeveloperCapistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
Nyros Technologies
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails Workshop
Alex Rupérez
 
Rack
RackRack
Rack
Revath S Kumar
 
Pyramid deployment
Pyramid deploymentPyramid deployment
Pyramid deployment
Carlos de la Guardia
 
Reusing your frontend JS on the server with V8/Rhino
Reusing your frontend JS on the server with V8/RhinoReusing your frontend JS on the server with V8/Rhino
Reusing your frontend JS on the server with V8/Rhino
Kenneth Kalmer
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
Eugenio Romano
 
1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)
Yuichiro MASUI
 
Tools of the CPAN Ninja
Tools of the CPAN NinjaTools of the CPAN Ninja
Tools of the CPAN Ninja
Aran Deltac
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
Sireesh K
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
Loiane Groner
 
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Ryosuke Uchitate
 
OpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integrationOpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integration
Michiel Kalkman
 
DevRock #01 What's new ASP.net 5
DevRock #01 What's new ASP.net 5DevRock #01 What's new ASP.net 5
DevRock #01 What's new ASP.net 5
Chaowlert Chaisrichalermpol
 
Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8
Katy Slemon
 
Capistrano
CapistranoCapistrano
Capistrano
Travis Roberts
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
 
Retrofit library for android
Retrofit library for androidRetrofit library for android
Retrofit library for android
InnovationM
 
Automake
AutomakeAutomake
Automake
Priyanka Kapoor
 
決済サービスのSpring Bootのバージョンを2系に上げた話
決済サービスのSpring Bootのバージョンを2系に上げた話決済サービスのSpring Bootのバージョンを2系に上げた話
決済サービスのSpring Bootのバージョンを2系に上げた話
Ryosuke Uchitate
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros DeveloperCapistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
Nyros Technologies
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails Workshop
Alex Rupérez
 
Reusing your frontend JS on the server with V8/Rhino
Reusing your frontend JS on the server with V8/RhinoReusing your frontend JS on the server with V8/Rhino
Reusing your frontend JS on the server with V8/Rhino
Kenneth Kalmer
 
Web components Introduction
Web components IntroductionWeb components Introduction
Web components Introduction
Eugenio Romano
 
1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)
Yuichiro MASUI
 
Tools of the CPAN Ninja
Tools of the CPAN NinjaTools of the CPAN Ninja
Tools of the CPAN Ninja
Aran Deltac
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
Sireesh K
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
Loiane Groner
 
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Ryosuke Uchitate
 
OpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integrationOpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integration
Michiel Kalkman
 
Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8Laravel mail example how to send an email using markdown template in laravel 8
Laravel mail example how to send an email using markdown template in laravel 8
Katy Slemon
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
 
Retrofit library for android
Retrofit library for androidRetrofit library for android
Retrofit library for android
InnovationM
 
決済サービスのSpring Bootのバージョンを2系に上げた話
決済サービスのSpring Bootのバージョンを2系に上げた話決済サービスのSpring Bootのバージョンを2系に上げた話
決済サービスのSpring Bootのバージョンを2系に上げた話
Ryosuke Uchitate
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 

Similar to Remote Config REST API and Versioning (20)

Leveraging Playwright for API Testing.pdf
Leveraging Playwright for API Testing.pdfLeveraging Playwright for API Testing.pdf
Leveraging Playwright for API Testing.pdf
Steve Wortham
 
Red5 - PHUG Workshops
Red5 - PHUG WorkshopsRed5 - PHUG Workshops
Red5 - PHUG Workshops
Brendan Sera-Shriar
 
Istio Playground
Istio PlaygroundIstio Playground
Istio Playground
QAware GmbH
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
Jim Jeffers
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
Aeshan Wijetunge
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
Fastly
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
أحمد عبد الوهاب
 
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with SpinnakerSpinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Andrew Phillips
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
Sapna Upreti
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
Dev_Events
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
John Congdon
 
GE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTGE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoT
Kai Zhao
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
Chris Bailey
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트) Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Improving the Accumulo User Experience
 Improving the Accumulo User Experience Improving the Accumulo User Experience
Improving the Accumulo User Experience
Accumulo Summit
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
Lou Sacco
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
Eugenio Romano
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
Leveraging Playwright for API Testing.pdf
Leveraging Playwright for API Testing.pdfLeveraging Playwright for API Testing.pdf
Leveraging Playwright for API Testing.pdf
Steve Wortham
 
Istio Playground
Istio PlaygroundIstio Playground
Istio Playground
QAware GmbH
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
Jim Jeffers
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
Fastly
 
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with SpinnakerSpinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Andrew Phillips
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
Sapna Upreti
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
Adding User Management to Node.js
Adding User Management to Node.jsAdding User Management to Node.js
Adding User Management to Node.js
Dev_Events
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
John Congdon
 
GE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTGE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoT
Kai Zhao
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
Chris Bailey
 
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
AWS Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
 Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트) Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Container Services – 유재석 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
Improving the Accumulo User Experience
 Improving the Accumulo User Experience Improving the Accumulo User Experience
Improving the Accumulo User Experience
Accumulo Summit
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
Lou Sacco
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
Eugenio Romano
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
Ad

Recently uploaded (20)

Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Lecture 13 (Air and Noise Pollution and their Control) (1).pptx
Lecture 13 (Air and Noise Pollution and their Control) (1).pptxLecture 13 (Air and Noise Pollution and their Control) (1).pptx
Lecture 13 (Air and Noise Pollution and their Control) (1).pptx
huzaifabilalshams
 
BCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdfBCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdf
VENKATESHBHAT25
 
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution ControlDust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Janapriya Roy
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
Gas Power Plant for Power Generation System
Gas Power Plant for Power Generation SystemGas Power Plant for Power Generation System
Gas Power Plant for Power Generation System
JourneyWithMe1
 
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis""Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
Infopitaara
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
MiguelMarques372250
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Crack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By VivekCrack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By Vivek
Vivek Srivastava
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Lecture 13 (Air and Noise Pollution and their Control) (1).pptx
Lecture 13 (Air and Noise Pollution and their Control) (1).pptxLecture 13 (Air and Noise Pollution and their Control) (1).pptx
Lecture 13 (Air and Noise Pollution and their Control) (1).pptx
huzaifabilalshams
 
BCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdfBCS401 ADA Second IA Test Question Bank.pdf
BCS401 ADA Second IA Test Question Bank.pdf
VENKATESHBHAT25
 
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution ControlDust Suppressants: A Sustainable Approach to Dust Pollution Control
Dust Suppressants: A Sustainable Approach to Dust Pollution Control
Janapriya Roy
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
Gas Power Plant for Power Generation System
Gas Power Plant for Power Generation SystemGas Power Plant for Power Generation System
Gas Power Plant for Power Generation System
JourneyWithMe1
 
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis""Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
Infopitaara
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
MiguelMarques372250
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Crack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By VivekCrack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By Vivek
Vivek Srivastava
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Ad

Remote Config REST API and Versioning

  • 1. Remote Con g REST API and Versioning shibuya.apk #24 @red_fat_daruma
  • 2. Agenda What's Remote Con g? How do we use Remote Con g? What can we do by using REST API? About Remocon
  • 3. Remote Con g Firebase family Change your app's behavior and view w/o distributing an update Completely free for now
  • 4. Uses Seasonal stuff which don't depend on device time e.g. promotions, component control etc. A/B testing User segment-based value distributions
  • 5. Of cial Client Libraries For Android, iOS, Web app Consist of 3 features Fetch con gs and cache them Set default values for missing keys Return an associated value with a key i.e. kinda GET-only KVS client w/ cache system
  • 6. Overview of Client Default & Fetched Con g are sources for Active Con g ref: https:// rebase.google.com/docs/remote-con g/api-overview
  • 7. Client libraries kindly handle troublesome problems! e.g. data consistensy, cache etc.
  • 8. But they are just readers... Cannot be used for Remote Con g management
  • 10. If you wanna update... Only web UI editor is available You need to click PUBLISH CHANGES after editing
  • 11. Web UI looks rich! but... No validations for values If you wanna use JSON value, that's horrible Cannot update automatically Publishers might forget to click PUBLISH CHANGES (I often do that) Diffs are not visible Who updated? What was changed? Not friendly for non-developers In addition, don't want them to open projects...
  • 12. 2018/03/13 Announcing the Remote Con g REST API https://goo.gl/twVB6w
  • 14. Remote Con g REST API Like single JSON object store and/or Firestore Not key-based management interface Get Fetch con gs from the server as a json le Update Put a json le to update con gs on the server ref: https:// rebase.google.com/docs/remote-con g/use-con g-rest
  • 15. Authentication Access token approach 1. Download a service account key of the project 2. Publish an access token (which has a time limit) by using Google API Client
  • 16. 1. Download a key SERVICE ACCOUNTS tab in your project setting
  • 17. Publish an access token For example, this is for python2. % sudo easy_install oauth2client % YOUR_EDITOR publish_access_token.py
  • 18. API Spec Endpoint https:// rebaseremotecon g.googleapis.com/v1/projects/${your_p roject_id}/remoteCon g Supported methods GET PUT (w/ a le upload) Accept-Encoding: deflate, gzip is required If missing, Etag is not included
  • 19. GET con gs The of cial sample is based on curl curl --compressed -D headers -H "Authorization: Bearer $token" -X GET "$ENDPOINT" -o "$output_file_path" # --compressed is required to see etag
  • 20. PUT con gs curl --compressed -i -H "Content-Type: application/json; UTF8" -H "If-Match: last-returned-etag" -H "Authorization: Bearer $token" -X PUT "$ENDPOINT" -d @filename_of_config_json # --compressed is required if you wanna see etag
  • 21. Web UI looks rich! but... (again) No validations for values If you wanna use JSON value, that's horrible Cannot update automatically Publishers might forget to click PUBLISH CHANGES (I often do that) Diffs are not visible Who updated? What was changed? Not friendly for non-developers In addition, don't want them to open projects...
  • 22. What we can do w/ REST API Value validations by your code Nested json is not allowed so json validator is still required Update automatically by your code PUT API publishes changes immediately Diffs would be visible on your VCS Non-developers can change con gs safely w/o rebase permission by your code
  • 23. Btw, are diffs readable between jsons?
  • 25. Okay, I'll do it by myself... so where is a sdk?
  • 26. THERE IS NO SDK
  • 27. Remocon Ruby Gem - https://github.com/jmatsu/remocon YAML-based RemoteCon g manager Additional features Validation system File content load
  • 28. How to use 1. Install remocon 2. Prepare an access token 3. export the following variables FIREBASE_PROJECT_ID REMOTE_CONFIG_ACCESS_TOKEN 4. Run commands!
  • 29. Get con gs remocon pull --dest=${output_dir}` Create 4 les con g.json : raw.json on the server etag : etag conditions.yml : condition de nitions parameters.yml : parameter de nitions
  • 30. Get con gs remocon pull --dest=${output_dir}` Create 4 les con g.json : raw json on the server etag : etag conditions.yml : condition de nitions parameters.yml : parameter de nitions Only parameters.yml is what you will update
  • 31. Update con gs Create a json le to be uploaded Of course, validations run in this section remocon create --conditions="/path/to/conditions.yml" --parameters="/path/to/parameters.yml"` And then, push it to the server remocon push --source="/path/to/config.json" --etag="/path/to/etag"
  • 32. Validation Just run the following command remocon validation --conditions="/path/to/conditions.yml" --parameters="/path/to/parameters.yml"`
  • 34. How does it work on CI? On feature branch Just validate On master Load a service account json Publish an access token Just push your les So it's like terraform's plan and apply ref: http://tech.mercari.com/entry/2018/04/09/110000
  • 35. Future work Diff-based update A prototype already worked on my local... More readable diff command Plugin system for validators Fix a bug which was found while creating these slides Make it stable... and 1.0.0 release
  • 36. Appendix1 Can we start with a blank remote con g? Yes. But you need to get the initial Etag by calling GET api. Can we update con gs regularly or speci c time? Partially yes. Firebase doesn't have such features, so we need to use a time-based job scheduler like cron. Can we create conditions by API? No. You need to create them from the console.
  • 37. Appendix2 Best practice for fetching Remote Con g https://goo.gl/Uw5nzq If you know how to build expressions of conditions, please let me know...!!!