Roll out the columnar-backed segment membership feature to SaaS. Supersedes #7405 (bitmap design).
Feature flags
segment_membership_inspection (Flagsmith on Flagsmith) — gates the SaaS rollout per organisation, plus the denylist for spend outliers.
Core concept
flagsmith-sql-flag-engine translates a segment's predicate tree to a SQL WHERE expression. Identities are mirrored from DynamoDB to ClickHouse — daily backfill during Alpha, retired during V1 in favour of Edge CDC (Dynamo Streams → S3 → ClickPipes → ClickHouse). Per-(segment, environment) counts cache in core Postgres on the SegmentMembership model. Members listing streams matched identities from ClickHouse, enriched with the canonical Dynamo record.
The IDENTITIES table is ReplacingMergeTree(inserted_at) ORDER BY (environment_id, id) with traits in a JSON column. Refresh queries use FROM IDENTITIES AS i FINAL to dedupe at read time so counts always reflect the latest backfill snapshot.
History: the Alpha PoC originally landed on Snowflake. After the 12/05/2026 RFC review the cost analysis tipped us toward ClickHouse for V1; the engine dialect (Flagsmith/flagsmith-sql-flag-engine#8) and the PoC backend (Flagsmith/flagsmith#7464) have since migrated.
RFC: Segment Membership Inspection (columnar) (private to Flagsmith team).
Roll out the columnar-backed segment membership feature to SaaS. Supersedes #7405 (bitmap design).
Feature flags
segment_membership_inspection(Flagsmith on Flagsmith) — gates the SaaS rollout per organisation, plus the denylist for spend outliers.Core concept
flagsmith-sql-flag-enginetranslates a segment's predicate tree to a SQLWHEREexpression. Identities are mirrored from DynamoDB to ClickHouse — daily backfill during Alpha, retired during V1 in favour of Edge CDC (Dynamo Streams → S3 → ClickPipes → ClickHouse). Per-(segment, environment) counts cache in core Postgres on theSegmentMembershipmodel. Members listing streams matched identities from ClickHouse, enriched with the canonical Dynamo record.The IDENTITIES table is
ReplacingMergeTree(inserted_at) ORDER BY (environment_id, id)with traits in aJSONcolumn. Refresh queries useFROM IDENTITIES AS i FINALto dedupe at read time so counts always reflect the latest backfill snapshot.History: the Alpha PoC originally landed on Snowflake. After the 12/05/2026 RFC review the cost analysis tipped us toward ClickHouse for V1; the engine dialect (Flagsmith/flagsmith-sql-flag-engine#8) and the PoC backend (Flagsmith/flagsmith#7464) have since migrated.
RFC: Segment Membership Inspection (columnar) (private to Flagsmith team).