No results for ""
EXPAND ALL
  • Home
  • API docs

Segment types

Read time: 4 minutes
Last edited: Oct 03, 2024

Overview

This topic explains different segment types and when to use them.

Types of segments

Each time you create a segment, you can choose from different segments types depending on your needs.

You can include contexts in a segment in the following ways:

  • Using targeting rules. For example, you could create a segment for everyone with an email ending in ".edu", or for all contexts with a "tier" attribute of "enterprise." When you define a segment using targeting, you can include and exclude individual targets and include targets that match specific rules.
  • Using a smaller list. For example, if you are collecting the emails of customers who want to participate in beta testing in a spreadsheet, you can define a segment by adding individual targets.
  • Using a larger list. For example, if you are importing very large lists of contexts from a third-party tool, you can define a segment by uploading a CSV file.
  • Syncing a list from a third-party application. For example, if you already keep a list of customers in another application, you can define a segment that automatically stays in sync with your external definition.

Rule-based and smaller list-based segments

Rule-based segments and smaller-list based segments can support targeting rules and lists of contexts where the number of individual contexts targeted is 15,000 or fewer.

Rule-based segments

Rule-based segments work well when you have a relatively small or well-defined group that you want to target. For example, you might create a rule-based segment when you want to target the following groups:

  • Everyone who uses your application and has an email ending in ".edu"
  • Employees in your company who have volunteered to participate in internal testing of new features
  • All contexts with a "tier" attribute of "enterprise"

You may notice that it's also possible to target each of these groups of contexts using targeting rules in a feature flag. However, it can simplify your configuration if you define the targeting rules in a segment, and then set up each flag to target the segment. If you create a segment, then you only have to define the targeting rules once. If your targeting rules ever change, you only have to change them in the segment. All of your feature flags that target the segment will automatically pick up the changes.

For some additional examples of working with rule-based segments, read Using entitlements to manage customer experience.

To learn how to create rule-based segments, read Create rule-based and smaller list-based segments.

Smaller list-based segments

Smaller list-based segments work well when you have lists of contexts you want to target that number 15,000 or fewer. Smaller list-based segments also support targeting rules.

To learn how to create smaller list-based segments, read Create rule-based and smaller list-based segments.

Larger list-based segments

Larger list-based segments are an Enterprise feature

Larger list-based segments are available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Larger list-based segments work well when you have lists of contexts you want to target that number more than 15,000. Larger list-based segments can include only one targeted context kind. These segments were previously called "big segments."

If you are working with server-side SDKs, larger list-based segments require persistent storage integration. You must configure this integration for each environment where you create larger list-based segments. To learn how, read SDK and integration configuration for segments.

List-based segments do not support targeting rules.

Synced segments

Synced segments are an Enterprise feature

Segments synced from external tools are available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Synced segments are segments that sync can their context targeting list with an external tool. Synced segments can support massive numbers of targets. The exact number is only limited by the persistent store you configure. All of the contexts within a synced segment must be of the same context kind.

To learn how to create synced segments, read Segments synced from external tools.

Implementation considerations with larger list-based segments and synced segments

You may be familiar with the concept of a "big segment," which is a term we previously emphasized in the LaunchDarkly documentation and user interface to describe some segments.

These segments are either:

  • a synced segment, or
  • a list-based segment with more than 15,000 entries that includes only one targeted context kind.

LaunchDarkly uses different implementations for different types of segments so that all of your segments have good performance.

Most of the time, you don't need to keep track of whether your segment is one of these two kinds or not. For example, you don't need to be aware of this when you are working with existing segments, or when you are using segments in your flag targeting rules.

There are two situations where you need to know whether you are using one of these two segment kinds or not:

  • If you are working with the REST API. Some of the REST API endpoints are specific to these segment kinds. To learn more, read Segments in the API documentation.
  • If you are using server-side SDKs and you are about to create your first synced segment or larger list-based segment in a new environment. LaunchDarkly SDKs refer to these as "big segments." Some additional configuration is required. To learn more, read SDK and integration configuration for segments.