62
www.parisjug.org 1 Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Introduction to Feature Toggle and FF4J

Embed Size (px)

Citation preview

Page 1: Introduction to Feature Toggle and FF4J

www.parisjug.org

1Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 2: Introduction to Feature Toggle and FF4J

2

PROPOSITION DE

FEATURE TOGGLE

Cédrick Lunven10 novembre 2015

Page 3: Introduction to Feature Toggle and FF4J

3

I. Introduction

III. FF4J

Agenda

Continuous Delivery Infrastructure Business Toggle

About me Feature Toggle

Introduction Main concepts Capabilities

Resources Backlog Recrutement

II. Use Cases

IV. Bonus Tracks

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 4: Introduction to Feature Toggle and FF4J

4

Cédrick Lunven

https://github.com/clun

https://fr.linkedin.com/in/clunven

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

@clunven

Release FF4JVersion 1.0.0

INTRODUCTION

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

Page 5: Introduction to Feature Toggle and FF4J

5

Data

Service

Presentation Feature

FeatureINTRODUCTION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 6: Introduction to Feature Toggle and FF4J

6

Feature Toggle

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

INTRODUCTION

check

« true »

Feature

OFF ON

« false »

Page 7: Introduction to Feature Toggle and FF4J

7

Feature Toggle

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

INTRODUCTION

Page 8: Introduction to Feature Toggle and FF4J

8

Feature Toggle

Enable & disable Features

At Runtime

Through dedicated GUI

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

INTRODUCTION

Page 9: Introduction to Feature Toggle and FF4J

9

Feature Toggle +

Enable ?

« yes »

Feature

OFF ON

« no »

Permissions unauthorized 

« granted »

users ACL

INTRODUCTION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 10: Introduction to Feature Toggle and FF4J

10

Here is the Magic

Feature Toggle ++INTRODUCTION

Business Toggle

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Enable ?

« yes »

Feature

OFF ON

« no »

Permissions unauthorized 

« granted »

users ACL

Customstrategy

« Predicate = true »

Page 11: Introduction to Feature Toggle and FF4J

11

I. Introduction

III. FF4J

Agenda

Continuous Delivery Infrastructure Business Toggle

Introduction Main concepts Capabilities

Resources Backlog Recrutement

II. Use cases

IV. Bonus Tracks

I. Introduction

About me Feature Toggling ?

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 12: Introduction to Feature Toggle and FF4J

12

USE CASES

Use cases

Continuous Delivery

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 13: Introduction to Feature Toggle and FF4J

13

Fork

branch « f1 »Merge

branch « f2 » conflicts

Release

Issues=>

Rollback

Release

Trunk

f1 => false

ReleaseRelease

Trunk

f2 => false f1 =>

true

Issues=> f1 =

false

Avoid Feature branching CONTINOUS DELIVERY : : USE CASES

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 14: Introduction to Feature Toggle and FF4J

14

Version N Version N+1

users beta testers

Dedicated infra?Version N+1

F. Toggle

users beta testers

Check Profile

Canary ReleaseCONTINOUS DELIVERY : : USE CASES

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 15: Introduction to Feature Toggle and FF4J

15

Load-Balancer

Version N Version N

F. Toggle F. Toggle

« on »

Load-Balancer

Version N+1 Version N+1

F. Toggle F. Toggle

Load-Balancer

Version N Version N+1

Consistency ?

Blue / Green DeploymentsCONTINOUS DELIVERY : : USE CASES

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 16: Introduction to Feature Toggle and FF4J

16

Load-Balancer

Version N Version N+1

Complex Policy

Version N+1 Version N+1

F. Toggle F. Toggle

Load-Balancer

Round robin

Check Weights

Dark LaunchCONTINOUS DELIVERY : : USE CASES

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 17: Introduction to Feature Toggle and FF4J

17

USE CASES

Use cases

Architecture & Infrastructure

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 18: Introduction to Feature Toggle and FF4J

18

Application

Ouverture Des

SOLDES

DDOs

F. Toggle

Application

ARCHITECTURE : : USE CASES

Graceful degradation

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 19: Introduction to Feature Toggle and FF4J

19

Default resources

Feature Toggle

DegradedBehaviour

Application

ARCHITECTURE : : USE CASES

Circuit Breaker

Toggle“OFF”

Breaker Strategy

Monitoring

Toggle“OFF”

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 20: Introduction to Feature Toggle and FF4J

20

Default resources

#2 -Toggle“OFF”

F. Toggle

Strategy

#1 - Check :• Availability• Latency,• Response

time, • Errors…

DegradedBehaviour

Application

Networking et Security

WhiteList

BlackList

HostName

Throttling

ARCHITECTURE : : USE CASES

Load Balancing

Region Based

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 21: Introduction to Feature Toggle and FF4J

21

USE CASES

Use cases

Business Toggle

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 22: Introduction to Feature Toggle and FF4J

22

Business Toggle

OfficeHour

Release Date

Expression

Rules Engine

A/B Testing

BUSINESS RULES

Enable ?

« yes »

Feature

OFF ON

« no »

Permissions unauthorized 

« granted »

Customstrategy

« Predicate = true »

Page 23: Introduction to Feature Toggle and FF4J

23

Le Feature Toggle ne doit pas être perçu uniquement comme une astuce technique pour éviter les branches (.. et introduire de la dette technique).

Bien employé, il apporte une vraie souplesse et de la valeur ajoutée pour adresser de nombreux cas d’usages.

SynthèseUSE CASES

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 24: Introduction to Feature Toggle and FF4J

24

I. Introduction

III. FF4J

Agenda

Continuous Delivery Infrastructure Business Toggle

About me Feature Toggling ?

Introduction Main concepts Capabilities

Resources Backlog Recruitment

II. Use cases

IV. Bonus Tracks

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 25: Introduction to Feature Toggle and FF4J

25

FF4J (ff4j.org)

Feature Flipping for JavaCreated in 2013Github (84✭)

SECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 26: Introduction to Feature Toggle and FF4J

26

Maven CentralSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 27: Introduction to Feature Toggle and FF4J

27

FeatureSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 28: Introduction to Feature Toggle and FF4J

28

FeatureSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 29: Introduction to Feature Toggle and FF4J

29

FeatureStore

FF4j

Import/load

Feature Store

Inject/ Init

SECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 30: Introduction to Feature Toggle and FF4J

30

Feature StoreSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

App A

F. Toggle

App B

F. Toggle

Toggle Toggle

Storage

F. ToggleService

AdminF. ToggleConsole

App A

F. Toggle Client

App B

F. Toggle Client

App C

F. Toggle Client

Page 31: Introduction to Feature Toggle and FF4J

31

Feature StoreSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 32: Introduction to Feature Toggle and FF4J

32

FF4jSECTION II : IMPLEMENTATION

FeatureStore

FF4j

Import/load

Inject/ Init

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 33: Introduction to Feature Toggle and FF4J

33

PermissionsSECTION II : IMPLEMENTATION

Enable ?

« yes »

Feature

OFF ON

« no »

Permissions unauthorized 

« granted »

users ACL

FeatureStore

AuthorizationManager

Import/load

Inject/ Init

FF4j

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 34: Introduction to Feature Toggle and FF4J

34

Roles

Integration Spring

PermissionsSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 35: Introduction to Feature Toggle and FF4J

35

Enable ?

« yes »

Feature

OFF ON

« no »

Permissions

 unauthorized 

« granted »

users ACL

Customstrategy

« Predicate = true »

Flipping StrategySECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 36: Introduction to Feature Toggle and FF4J

36

Administration ConsoleSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 37: Introduction to Feature Toggle and FF4J

37Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

?

Page 38: Introduction to Feature Toggle and FF4J

38

- - -SECTION II : IMPLEMENTATION

Page 39: Introduction to Feature Toggle and FF4J

39

Toggling through AOPSECTION II : IMPLEMENTATION

Page 40: Introduction to Feature Toggle and FF4J

40

App1

ff4j

Store

Node B

ff4j

Store

Node A

App2

ff4j

Store

Node B

ff4j

Store

Node A

Cache Cache

App

ff4j

Store

Node B

ff4j

Store

Node A

Cache

FF4j

AuthorizationManager

FeatureStoreCacheProxy

FeatureStore

CachingSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 41: Introduction to Feature Toggle and FF4J

41

TaglibSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 42: Introduction to Feature Toggle and FF4J

42

Feature GroupSECTION II : IMPLEMENTATION

Page 43: Introduction to Feature Toggle and FF4J

43

ff4j

Store

App

REST API

PHPJS

.NET

Devices

SECTION II : IMPLEMENTATION

. . .REST API

Page 44: Introduction to Feature Toggle and FF4J

44

ff4j

Store

App

Console

REST API

Console StandAlone

Console standalone

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

SECTION II : IMPLEMENTATION

Page 45: Introduction to Feature Toggle and FF4J

45

Console standaloneSECTION II : IMPLEMENTATION

Page 46: Introduction to Feature Toggle and FF4J

46

SECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

. . .Monitoring

Page 47: Introduction to Feature Toggle and FF4J

47

ff4j

Store

App

MBEAN

Support JMX

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

SECTION II : IMPLEMENTATION

Page 48: Introduction to Feature Toggle and FF4J

48

PropertiesSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 49: Introduction to Feature Toggle and FF4J

49

Property StoreSECTION II : IMPLEMENTATION

PropertyStore

FF4j

Import/load

Inject/ Init

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 50: Introduction to Feature Toggle and FF4J

50

Property StoreSECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 51: Introduction to Feature Toggle and FF4J

51

Autowiring !SECTION II : IMPLEMENTATION

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 52: Introduction to Feature Toggle and FF4J

52

I. Introduction

III. FF4J

Agenda

Continuous Delivery Infrastructure Business Toggle

Introduction Main Concepts Capabilities

Resources Backlog Recrutement

II. Use cases

IV. Bonus Tracks

About me Feature Toggling ?

Copyright @ 2015 ParisJug. Licence CC - Creative Commons 2.0 France – Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique

Page 53: Introduction to Feature Toggle and FF4J

53

Getting StartedSECTION III : Bonus track

https://github.com/clun/ff4j-extra/tree/master/ff4j-samples

Page 54: Introduction to Feature Toggle and FF4J

54

Getting SupportSECTION III : Bonus track

2

1

Page 55: Introduction to Feature Toggle and FF4J

55

Roadmap

CassandraElasticSearch

Eureka

CouchDB

Consul ZooKeeper

NoSQL

ServiceRegistry

Spring-Data

HazelCastCache Aerospike HBase …

Permissions Shiro OAuth2

NPM Install

JAAS

JCache

JPAFeatureStore / PropertiesStore

Others

SECTION III : Bonus track

Archaius

Page 56: Introduction to Feature Toggle and FF4J

56

Pourquoi pas vous ?SECTION III : Bonus track

Page 57: Introduction to Feature Toggle and FF4J

57

Test, comment, react, Tweet..

Thank You !

Page 58: Introduction to Feature Toggle and FF4J

58

Sponsors

5801/05/2023

Page 59: Introduction to Feature Toggle and FF4J

59

FF4j vs Togglz (1)APPENDICES

Page 60: Introduction to Feature Toggle and FF4J

60

TogglzINTRODUCTION

Page 61: Introduction to Feature Toggle and FF4J

FF4JFF4J

FEATURE FLIPPING FOR JAVA

Storage

FeatureAOP

FlippingCustomRules Audit REST

API Caching

ToggleGroups

RolesACL

ImportExport Taglib Custom

Properties

Consoles

RDBMS Mongo Redis httpClient

InMemory

Servlet J2EFullStack JMX SSH

Page 62: Introduction to Feature Toggle and FF4J

FF4J

FF4J