14 Apr 2017

Go Serverless, not Flagless: Implementing Feature Flags in Serverless Environments

A demonstration of LaunchDarkly feature flags with AWS Lambda

Serverless architecture, while a relatively new pattern in the software world, is quickly becoming a valuable asset in a variety of use cases.

There are some notable business advantages to serverless architecture:

  • Faster development – easily harness existing backend services and third party APIs to quickly build and deploy apps.
  • Lower cost – substantially decreased operational costs by not having to manage infrastructure in addition to the componentization of the entire application (only scale what you need to scale).
  • Less maintenance – scaling, load balancing, and patches are a thing of the past, serverless platforms take care of it all for us.

Coupled with feature flags, a serverless application allows teams to control feature releases without having to redeploy, which is especially useful for serverless applications that tend not to focus on persistence and be more stateless in nature.

In this article, we’ll start with the assertion that you have already decided that serverless functions makes the most sense for your application architecture. What you really need is the ability to continue using feature flags in this type of architecture. This is where LaunchDarkly has got you covered.

Let’s start with a simple app model that stores a bit of user data on demand and that can retrieve values when requested. This app is going to include the use of two AWS Lambda functions an API Gateway, and ElastiCache to build a serverless pipeline. AWS Lambda lets you run code without provisioning or managing servers.  On the other hand, LaunchDarkly is a feature flag management platform that allows you to easily create and manage feature flags at scale.

Storing Flag Configurations

AWS turns out to be a well-equipped platform for serverless feature flagging. In our implementation, we create a webhook in LaunchDarkly to hit an API Gateway endpoint which acts as a trigger for invoking a lambda function.

Then, the lambda function can have LaunchDarkly populate a Redis ElastiCache cluster by initializing its SDK with the built-in “RedisFeatureStore” option. This lambda function built on the NodeJS runtime would look something like this:

Processing Feature Flags

Now that our flag configurations are neatly stored in the Elasticache cluster, a second Lambda function may be used to retrieve and process flags without waiting for any outbound connections to LD! This is achieved by enabling LaunchDarkly Relay mode in the SDK options. The function’s “event” parameter can be used to pass in a user to be evaluated by the LaunchDarkly SDK.

Take Aways

It’s important to understand that there are multiple ways to implement feature flags in your serverless architecture.  The method will depend on your app’s structure, your serverless provider, and your implementation timeline. You can check out this guide to feature flagging for best practices and ways to get started.

 

07 Apr 2017

Feature Flag Transition & Setup Guide

A step-by-step guide for integrating LaunchDarkly into your app and adopting feature flagging best practices

You’re now at a decision point. You want to buy a feature flagging management solution, but you are not sure how difficult the switch might be. You either have an existing system in place or you’ve never tried feature flagging before.

The transition process is actually not as daunting as you think. In fact, it’s an opportunity to clean up technical debt, mitigate risk, and start deploying better software, faster. From start to finish, this guide will walk you through the process of successfully integrating LaunchDarkly into your development process.

1. New Team Member Orientation

  • Use the QuickStart tutorial.  Create a feature flag for the platform of your choice using the step-by-step tutorial. We provide well-documented SDKs for Java, JavaScript, PHP, Python, Go, Node.JS, .NET, Ruby, Python Twisted, iOS, and Android.
  • Install LaunchDarkly in a test app.  In the QuickStart section, select “Install an SDK”.  Use this guide to install a simple feature flag in the test app of your choice. LaunchDarkly provides “hello-world” test apps to help you get familiar.
  • Check out our documentation. It’s important to understand the LaunchDarkly fundamentals.  In LaunchDarkly, feature flags are evaluated in-memory using one of our SDKs. Our user interface (app.launchdarkly.com) lets you create feature flags and targeting rules that are streamed to our SDKs in real-time.  You pass user objects to our SDKs, which evaluate the appropriate flag values for those users in microseconds. These feature flag events are sent asynchronously to LaunchDarkly, allowing you to easily manage users via our dashboard.
  • Start targeting users and playing with percentage rollouts.  Go to your feature flag dashboard and select a feature flag (docs).
    • On the targeting tab, you can:
    • Target individual users
    • Create custom targeting rules
    • Manage percentage rollouts
    • Set a default rule
    • Set an off variation
  • Create a multivariate flag. LaunchDarkly can do more than just evaluate true and false feature flags. Create multivariate flags that have multiple flag variations. These variations can be strings, numbers, and JSON arrays/objects.

2. Select a coordinator and document the transition

Your coordinator will take ownership of the transition process.

  • This coordinator should be familiar with feature flagging best practices and serve as the primary contact between your organization and LaunchDarkly.
  • Construct a document and/or use your issue tracker to itemize the switch. This is an opportunity to implement best practices in your development and release process.

3. Separate feature flags from configuration values

Scan your application and identify your feature flags.

  • It’s important to understand what a feature flag is, and what it isn’t.
  • The primary purpose of a feature flag is to control access to a feature based on the context of a user. On the other hand, a configuration value is primarily used to configure a permanent parameter, irrespective of a user’s context.
  • Feature flag use cases
    • Roll out a new checkout flow to 1%, 10%, and 100% of your users
    • Toggle a new beta feature for your beta testers
    • Sunset a poorly performing feature
    • Manage a long-term state, like maintenance mode or subscription plans
    • Serve a new upgrade to users who live in Canada and have an Android phone
  • Configuration value use cases
    • Set the hostname for your application server
    • Set authentication credentials and settings for services and backend stores
    • Set static rate limits for your application service
    • Set a directory path for data storage

4. Clean up technical debt by removing old flags

Remove the feature flags you don’t want anymore

  • This process is an opportunity to mitigate technical debt and remove all of the clutter from the past. LaunchDarkly has flag statuses that indicate when you particular feature flags are safe for removal.

5. Identify components that you would like to flag

Now that feature flagging will be easy, you should identify components of your application or particular processes that you would like to feature flag.

  • LaunchDarkly supports both boolean and multivariate feature flags. Boolean flags return true and false, but multivariate flags can return strings, number, JSON objects/arrays. You should hold a brainstorming session where everyone can identify the existing components they would like to flag.

6. Setting up your feature flags

If you have existing flags, you can use LaunchDarkly’s REST API to import your existing flags.

  • You can also use the API to bulk create new flags or simply use the LaunchDarkly UI.

To organize and document your feature flags, LaunchDarkly lets you add a name, description, and tags to each feature flag.

  • You can also name and provide descriptions for variations
  • Your team should decide the best ways to standardize naming conventions

7. Invite your team and start releasing faster with less risk

The coordinator should onboard team members, help set up projects and environments, and ensure that permissions are properly calibrated.

  • Develop guidelines for what new features need to flagged and how you will use LaunchDarkly to practice feature flag-driven development

We’re here to help!

We want to make the transition fast, easy, and productive for you and your entire team. Contact us at support@launchdarkly.com and we will answer all of your questions, provide guidance, and help you get started.

03 Mar 2017

Launched: Feature Flag Variation Editing

LaunchDarkly Feature Flag Variation Editor

Feature flags are powerful when serving variations like true and false. However, they are even more powerful when you can serve variations that are strings, numbers, JSON objects, and JSON arrays — which we call multivariate feature flags.

Previously, we allowed you to create multivariate feature flags with defined variations, but we did not let you add, edit, or delete variations once they were created. Now, you can!

With support for edit variations, you can now edit feature flags after they are created.

You can now:

  • Manage pricing in an e-commerce app by serving number variations
  • Dynamically control configuration values
  • Serve hex values to control CSS styles
  • Sunset variations that are no longer necessary

Editing Variations

When you navigate to any feature flag, you will notice a new Variations tab. This is where you will be able to edit your flag’s variations.

For boolean flags, you can edit a variation’s name and description, but not the value. This is because boolean flags can only serve true and false values.

LaunchDarkly Feature Flag Variation Editor

For multivariate flags, you can now add, edit, and delete variations even after the flag is created. Moreover, you can edit any variation’s value, name, and description. Keep in mind that you cannot change the “type” of variation being served after the flag is created.

LaunchDarkly feature flag variation editor

When you add, edit, or delete a variation for a multivariate flag, the change will apply to all environments within that project. For example, if you have a feature flag called “Checkout Flow” with 4 variations: A, B, C, D and you deleted variation D, then every environment will only have 3 variations (A, B, C) for the “Checkout Flow” feature flag.

We’re excited to deliver this new feature to you and would love to hear your feedback at support@launchdarkly.com.  You can reference our docs for more info.

10 Feb 2017

LaunchDarkly Values

LaunchDarkly Team
  • Respect and integrity for our team, our customers, and our community.
  • We believe in teams, not fiefdoms. Leaders, not tyrants.
  • We’re building a place where you can learn and grow.
  • Work is not life.

When John & I started LaunchDarkly, we’d known each other for years, since being undergraduates at Harvey Mudd College. Part of why we started the company together is that we shared common values about the company that we wanted to work at. As a founder, you’re not only building a product – you’re building a culture.

As we got bigger, it was time to formalize our values from tribal “this is the way we work” knowledge to something more scalable. We surveyed our current team, and I was thrilled that, what I thought our values should be, the team already thought were in place. We reviewed our values at our last team meeting, and everyone gave an example of the time they’ve seen them practiced.

“Values are valuable when you have a hard decision to make,” is John’s and my view. By making our values public, we hope both our customers and our team can know who we are.

25 Oct 2016

Launched: Slack and HipChat Integrations

LaunchDarkly Atlassian HipChat and Slack Feature Flag Notifications / Integrations

Feature flag driven development encourages communication between product, engineering, and business for faster, more coordinated releases. To help facilitate this, we are excited to announce a Slack and HipChat integrations to sync LaunchDarkly notifications with your team’s messaging platform.

Benefits

  • Know when feature flags are turned on / off or rolled out to users
  • Get notified when flags are created or deleted
  • Know which team members have modified flags
  • Create custom policies to stream changes to individual chat rooms
  • Coordinate releases and know when changes go live

LaunchDarkly Atlassian HipChat and Slack Feature Flag Notifications / Integrations

Rich Notifications

Each notification contains a rich description of the who, what, and when of any activity in LaunchDarkly, including activities is triggered via our API.

LaunchDarkly Feature Flag Slack Notifications

LaunchDarkly Feature Flag HipChat Notifications

Chat Integrations

LaunchDarkly’s Slack and HipChat integrations allow you to set up incoming webhooks to receive any activities in LaunchDarkly. When something is changed (e.g. when a feature flag is updated, when a new team member is invited to LaunchDarkly, and more) we’ll send an incoming webhook to Slack or HipChat, or both.

LaunchDarkly Slack and HipChat Chat Notifications - Feature Flags and Feature Toggles

You can also create custom policies for granular control over what types of notifications are sent to each room. For example, you can have changes to rollouts and targeting rules streamed to your Product room, while having team management notifications streamed to your Team room.  Custom policies are available for both Slack and HipChat.

We’d love to hear from you at support@launchdarkly.com with any questions or feedback!

29 Jun 2016

Launched: Event Stream API

One of LaunchDarkly’s core strengths is that the entire product is driven by a REST API.  This means that everything in the app can be accessed programmatically– including modifying feature flags, goals, accessing A/B test results, and more.

There was one notable exception to this— we did not provide a way for customers to access their raw analytics events. This can be a huge amount of data, so a normal queryable REST API is not the most reasonable solution.

Real-Time Event Stream API

To fill this gap, we have launched an event stream API that provides a real-time stream of raw analytics data.  These events include feature flag requests, analytics events, custom events, and more.

LaunchDarkly Event Stream API A/B Testing Analytics and Data

Benefits

Customers can harness the event stream API for their own internal analytics platforms or build custom integrations tailored to their specific needs.  You can then leverage user data to analyze metrics like conversions, revenue, and application performance.

Connecting to the stream

Accessing the API is simple. This is how to do it with curl:

Check out the documentation for more information.