Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Firebase Remote Config - Pro Tips

Firebase Remote Config - Pro Tips

Pro tips for using Firebase Remote Config as feature-flag engine in mobile apps.

Presentation given at Seven Masters by iMasters, Firebase Edition (august / 2017).

Ubiratan Soares

August 31, 2017
Tweet

More Decks by Ubiratan Soares

Other Decks in Programming

Transcript

  1. REMOTE CONFIG
    pro tips
    Ubiratan Soares
    August / 2017

    View full-size slide

  2. Attention to tool
    limits and policies
    1

    View full-size slide

  3. Do not forget to
    provide the
    default values
    2

    View full-size slide

  4. // At application setup level
    FirebaseRemoteConfig
    .getInstance()
    .setDefaults(R.xml.remote_config_defaults);
    ➜ ~/path/to/app/main tree res
    res
    !"" xml
    !"" remote_config_defaults.xml

    View full-size slide

  5. Beware of backward
    compatibility for
    configs
    3

    View full-size slide

  6. Assign values by
    build type per
    config
    4

    View full-size slide

  7. Choose the proper
    activate / fetch
    strategy for configs
    5

    View full-size slide

  8. Default Expires = 12h
    activateFetched()
    Async Fetching
    RemoteConfig SDK
    ACTUAL
    VALUES
    getXYZ()
    CACHED VALUES
    fetch(timeToCache)

    View full-size slide

  9. Are the upated
    values for configs
    needed right now ?

    View full-size slide

  10. Load values for the next
    time usage, at application
    lifecycle level.
    For non-critical configs

    View full-size slide

  11. If you cannot wait for the
    next interaction with your
    app …
    Can user wait for the actual
    values for configs at current
    app section ?

    View full-size slide

  12. Waiting for refresh
    Fetch and activate using
    callback and provide the
    proper visual feedback
    (usually a blocking, loading screen)

    View full-size slide

  13. If actual config
    values are critical
    for feature …

    View full-size slide

  14. Fetch and activate using
    callback before user
    interaction with remote-
    controled feature
    No delays accepted

    View full-size slide

  15. Find a way to override
    config`s local caching
    when needed
    6

    View full-size slide

  16. Default Expires = 12h
    activateFetched()
    Async Fetching
    RemoteConfig SDK
    ACTUAL
    VALUES
    getXYZ()
    CACHED VALUES
    fetch(timeToCache)

    View full-size slide

  17. Monitor application
    foreground / background
    dance and re-fetch with
    cache invalidation at
    transition

    View full-size slide

  18. Force a
    fetch with cache purging
    + activate using a
    push notification

    View full-size slide

  19. FINAL REMARKS
    • RemoteConfig is a great tool for feature-flagging
    • Deadly simple to integrate with provided SDKs
    • Beware of basics (default values, limitations, config compatibilities, etc)
    • Choose the proper fetch+activate strategy for each config

    View full-size slide

  20. UBIRATAN
    SOARES
    Computer Scientist by ICMC/USP
    Software Engineer, curious guy
    Google Developer Expert for Android
    Teacher, speaker, etc, etc

    View full-size slide

  21. THANK YOU
    @ubiratanfsoares
    ubiratansoares.github.io
    https://br.linkedin.com/in/ubiratanfsoares

    View full-size slide