Skip to Content
DocsCore Concepts

Core Concepts

Understanding the fundamental concepts of Feature Management is key to using GoGreen effectively.

1. Feature Flags

At its core, a feature flag is a decision point in your code. It allows you to change behavior without deploying new code.

  • Boolean: Simple On/Off toggle.
  • String: Configuration values (e.g., color hex codes, theme names).
  • Number: Numeric thresholds (e.g., rate limits, timeout values, percentage caps).
  • JSON: Structured configuration objects for complex feature settings.

Each flag can have multiple variations — for example, a string flag might have variations for "control", "variant-a", and "variant-b".

Flag Lifecycle

Flags progress through lifecycle states:

  • Active: Currently in use and being evaluated.
  • Stale: Not evaluated for 30+ days (auto-detected by a background worker). Consider archiving or cleaning up.
  • Permanent: Explicitly marked as long-lived (excluded from stale detection).
  • Archived: Soft-deleted. No longer evaluated but retained for audit history.

Prerequisites

Flags can depend on other flags. A prerequisite ensures that flag A is only evaluated when flag B has a specific value. Prerequisites support a maximum depth of 10 to prevent circular dependencies.

2. Targeting Rules

Targeting rules determine who sees which variation of a flag. Rules are evaluated in order — the first match wins.

  • User Identity: Target specific user keys (great for internal testing).
  • User Attributes: Target by any custom attribute (email, country, plan, device, etc.).
  • Segments: Reusable groups of users (e.g., “Beta Testers”, “Enterprise Customers”).

Operators

GoGreen supports 17+ targeting operators across multiple categories:

CategoryOperators
Stringequals, contains, starts with, ends with, matches regex
Numericequals, greater than, less than, between
Semverequals, greater than, less than
Datebefore, after
Collectionin list, not in list, contains any, contains all

Default Rule & Fallthrough

If no targeting rule matches, the default rule applies. You can set a fallthrough variation or use percentage-based allocation for gradual rollouts.

3. User Segments

Segments are reusable groups of users that can be referenced in targeting rules across multiple flags.

  • Rule-based: Define segments with attribute rules (e.g., plan = "enterprise" AND country IN ["US", "UK"]).
  • List-based: Upload specific user keys via CSV or JSON bulk import (supports up to 1M entries).

When you update a segment, all flags referencing it automatically pick up the change.

4. Environments

Environments represent stages in your deployment pipeline.

  • Development: For local testing.
  • Staging: For pre-production verification.
  • Production: Live user traffic.

Each environment has:

  • Independent SDK keys that can be rotated without affecting other environments.
  • Independent flag states — a flag can be enabled in staging but disabled in production.
  • Protection rules — require approvals from specific roles before changes go live (e.g., production requires two reviewers with the approver role).

5. Rollouts

Rollouts allow you to gradually release a feature to a percentage of your users.

  • Percentage Rollout: “Show this feature to 10% of users.”
  • Sticky Bucketing: Ensures a user remains in the same bucket (Control vs Treatment) consistently, using MurmurHash3 on their user key.
  • Automated Ramp-up: Schedule rollout percentages to increase over time (e.g., 5% on Monday, 25% on Wednesday, 100% on Friday).

6. Experimentation

GoGreen has built-in A/B testing and experimentation capabilities.

  • Experiment Lifecycle: Create experiments in draft, start them (begins data collection), and stop them (freezes results).
  • Metrics & Goals: Define success metrics and track them via event ingestion.
  • Statistical Analysis: T-test for numeric metrics and chi-squared test for categorical metrics, with p-value computation and confidence intervals.
  • Event Analytics: Powered by ClickHouse with hourly/daily/monthly aggregation rollups.

Track events from your SDKs using client.Track("purchase", { revenue: 49.99 }) and view results in the dashboard.

7. Scheduled Changes

Queue flag changes for future execution:

  • Set a date/time for a flag to be enabled, disabled, or have its targeting rules modified.
  • A background worker executes changes at the scheduled time.
  • All scheduled changes are recorded in the audit log.

8. Approval Workflows

For regulated environments, require team approval before changes go live:

  • Environment Protection Rules: Configure per-environment policies (e.g., production requires 2 approvals from users with the approver role).
  • Review Flow: Changes are submitted for review; reviewers approve or reject with comments.
  • Audit Trail: Every approval decision is logged.

9. Integrations

GoGreen integrates with your existing tools:

IntegrationCapabilities
SlackFlag change notifications, approval requests
Microsoft TeamsFlag change notifications, approval requests
JiraLink flags to tickets, sync lifecycle
DatadogPush flag change events as APM markers
New RelicPush flag change events as deployment markers
DynatracePush flag change events as custom events
WebhooksHMAC-SHA256 signed payloads to any HTTP endpoint

10. Evaluation Strategy

GoGreen supports two main evaluation strategies:

Client-Side

  • Where: On the user’s device (Browser, Mobile).
  • How: The SDK fetches all flag configurations at init, then evaluates locally with 0ms latency.
  • Best For: UI changes, feature toggles, responsive experiences.
  • Note: Never put sensitive logic in client-side code, as the flag rules are visible.

Server-Side

  • Where: On your backend server.
  • How: The SDK evaluates locally using cached configuration, or calls the Evaluation API for remote evaluation.
  • Best For: API logic, billing rules, database queries, sensitive algorithms.
  • Secure: Rules and logic are hidden from the client.

Streaming vs Polling

SDKs support two modes for receiving flag updates:

  • Streaming (SSE): Real-time updates with automatic reconnection and multi-region failover. Recommended for production.
  • Polling: Periodic fetch at a configurable interval. Simpler but introduces latency.

11. Billing & Quotas

GoGreen includes built-in subscription management:

  • Plans: Community (free), Growth, and Enterprise tiers with different feature access and limits.
  • Usage Metering: Tracks six dimensions — API calls, flag evaluations, events ingested, seats, environments, and flags.
  • Quota Enforcement: Requests exceeding plan limits receive 429 Too Many Requests with guidance to upgrade.
  • Stripe Integration: Subscription lifecycle, invoicing, and webhook handling.

12. GDPR & Privacy

GoGreen provides tools for data privacy compliance:

  • PII Redaction: SDKs support configurable redaction strategies (hash, mask, or drop) for user attributes marked as private.
  • Private Attributes: Mark specific attributes as private per-user or globally. Private attributes are stripped before events are sent to the server.
  • Data Export: Request a full export of all data associated with a user key.
  • Data Deletion: Request deletion of all data associated with a user key.