Keep the previous pricing rule executable until every decision point has stopped admitting the new rule. For a logistics startup with React clients and a Node.js quote service, the rollback boundary is the server's choice of rule version, and a successful flag change alone does not prove that boundary has moved.
TL;DR: Choose a standalone feature flag API when release toggles are the job and your application already owns the rollout evidence. Choose PostHog when you also want the product analytics context. For either choice, bind each candidate rule to an immutable storage artifact, evaluate eligibility on the server, and rehearse reverting future quotes while preserving prices already accepted.
Stop new exposure.
The runbook below uses proposed acceptance criteria and an illustrative workload; neither represents a production incident or benchmark. Its question is operational: what evidence lets an on-call engineer declare a pricing rollback complete?
How should PostHog or standalone feature flags prove a pricing rollback?
A logistics pricing change can be technically available while producing unacceptable quotes. Define correctness and availability separately: the quote endpoint's availability SLO says whether customers can obtain an answer, while a release acceptance check says whether the answer follows the intended pricing version. A healthy request rate cannot establish pricing correctness.
Suppose the candidate introduces a different surcharge rule. Preserve the previous rule artifact and its identifier, record which version produced each quote, and decide before rollout what happens to an accepted quote when the flag changes. The proposed policy here is to preserve accepted quotes and apply rollback to subsequent pricing decisions. That policy is application behavior; a flag provider cannot choose it for you.
This matters because React can show an older value after the Node.js service has adopted a new decision, and separate server processes can refresh their flag state at different times. Keep the authoritative choice in Node.js. Record the selected version with the quote so that support and reconciliation can explain an amount without reconstructing whichever flag state happens to exist later.
A boolean isn't evidence.
For polling clients, a rollback budget must include the poll interval, refresh failures, and any application cache lifetime. Use a bounded maximum age for a cached decision; after that age, the proposed safe behavior is to stop admitting the candidate and select the previous rule. The trade-off is deliberate: lose rollout continuity to gain a tighter exposure boundary, while continuing to serve quotes with the previous rule.
Buy versus build around the rollback boundary
The useful PostHog versus standalone feature flag API comparison starts with who owns evidence and operational work. It does not start with an advertised unit price.
| Choice | What the team buys or builds | Fit for this pricing release | Limitation or operational boundary |
|---|---|---|---|
| PostHog | A product analytics platform with feature flags | Evaluate it when connecting release decisions to product analysis is part of the job | Decide whether adopting the wider analytics stack is justified for a release-toggle requirement |
| LaunchDarkly | A dedicated feature management product | Evaluate it when feature management itself deserves a separate system | Verify the required controls and client refresh behavior before committing the rollback budget |
| Unleash | A dedicated feature flag alternative | Include it when comparing managed services with operating a flag system | For self-hosting, assign responsibility for capacity, upgrades, and on-call coverage |
| Application-owned toggles | The team builds state distribution, naming, evidence, and cleanup | Reasonable only when that maintenance has an explicit owner | Every distribution and recovery mechanism becomes platform work |
Infrai offers a unified API with one API key, one wallet, and one bill: storage and flag checks use the same REST API with no SDK required. Its self-describing API has public discovery with no key required, request and response schemas, and runnable examples, which makes the storage-to-flag contract inspectable before integration. Its limitation is the operational boundary around flags: clients poll, and change audit logs, evaluation statistics, parent-child dependencies, and a deletion recycle bin are outside the feature set.
Choose the lightweight route only when application-owned analytics and disciplined flag cleanup are acceptable. It is not suitable for a requirement that the flag service itself provide experiment analysis or lifecycle governance. That's a real ownership decision.
The evidence stack deserves its own comparison. Prometheus is relevant for instrumented service metrics and their cardinality constraints; evaluate Grafana for a shared rollback dashboard over your chosen evidence sources, and PostHog for product analytics context. These are different jobs. A dashboard is an observation surface, and the application must still enforce the pricing-version decision.
For an illustrative fleet of 120 server processes refreshing every 15 seconds, the steady request budget is 8 refreshes per second before retries. Those are planning inputs, not vendor limits. Add jitter and account for restart bursts; a service that is quiet in steady state can still synchronize its clients during deployment. Keep evaluation near the authoritative quote decision and avoid making every browser tab a privileged control-plane client.
Bind the storage artifact to the eligibility check
The storage-to-flag handoff should carry a revision identity, rather than depend on an operator remembering which dashboard they changed first. Database branches, snapshots, and flags are a useful coordination goal, but this implementation uses the verified storage object metadata and flag-check contracts. A stored pricing artifact is a release checkpoint; it should not be represented as a database snapshot.
The following runnable Go preflight reads the metadata for an existing pricing artifact, extracts a revision string using an operator-configured JSON Pointer, hashes that identity into a flag key, and reads that flag through the same key and base URL. It performs no mutations. Provision the corresponding flag before using the check, and preserve the prior artifact separately. The pointer is application configuration selected after inspecting the storage response schema, rather than an assumed provider field.
Set BACKEND_BASE_URL to the service's documented v1 base, INFRAI_API_KEY to the server-side credential, PRICING_BUCKET and PRICING_OBJECT to the existing artifact, and REVISION_POINTER to the JSON Pointer for its stable revision string. This program refuses to guess that response field. It prints the flag response for contract verification; the Node.js service must interpret that response according to the published schema before admitting traffic.
package main
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
)
func required(name string) string {
value := os.Getenv(name)
if value == "" { panic("missing environment variable: " + name) }
return value
}
func get(client *http.Client, base, key, path string) []byte {
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequest(http.MethodGet, base+path, nil)
if err != nil { panic(err) }
req.Header.Set("Authorization", "Bearer "+key)
res, err := client.Do(req)
if err != nil { panic(err) }
body, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil { panic(err) }
if res.StatusCode == http.StatusTooManyRequests && attempt < 3 {
delay := time.Second * time.Duration(1<<attempt)
retry := res.Header.Get("Retry-After")
if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 {
if wait := time.Duration(seconds)*time.Second; wait > delay { delay = wait }
} else if when, err := http.ParseTime(retry); err == nil {
if wait := time.Until(when); wait > delay { delay = wait }
}
time.Sleep(delay)
continue
}
if res.StatusCode < 200 || res.StatusCode >= 300 {
panic(fmt.Sprintf("status %d: %s", res.StatusCode, body))
}
return body
}
panic("retry budget exhausted")
}
func main() {
base := strings.TrimRight(required("BACKEND_BASE_URL"), "/")
parsed, err := url.Parse(base)
if err != nil || parsed.Scheme != "https" || parsed.Host == "" ||
parsed.User != nil || parsed.RawQuery != "" || parsed.Fragment != "" ||
parsed.Path != "/v1" { panic("expected an HTTPS v1 base URL") }
key := required("INFRAI_API_KEY")
client := &http.Client{Timeout: 10*time.Second, CheckRedirect: func(
req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }}
path := "/storage/object/head/" + url.PathEscape(required("PRICING_BUCKET")) +
"/" + url.PathEscape(required("PRICING_OBJECT"))
var metadata any
if err := json.Unmarshal(get(client, base, key, path), &metadata); err != nil { panic(err) }
pointer := required("REVISION_POINTER")
if !strings.HasPrefix(pointer, "/") { panic("expected a nonempty JSON Pointer") }
for _, part := range strings.Split(pointer[1:], "/") {
part = strings.ReplaceAll(strings.ReplaceAll(part, "~1", "/"), "~0", "~")
switch value := metadata.(type) {
case map[string]any:
metadata = value[part]
case []any:
index, err := strconv.Atoi(part)
if err != nil || index < 0 || index >= len(value) { panic("invalid array index") }
metadata = value[index]
default:
panic("revision pointer does not resolve")
}
}
revision, ok := metadata.(string)
if !ok || revision == "" { panic("revision must be a nonempty string") }
digest := sha256.Sum256([]byte(revision))
flag := "pricing_revision_" + hex.EncodeToString(digest[:])
decision := get(client, base, key, "/flags/is_enabled/"+url.PathEscape(flag))
fmt.Printf("flag=%s response=%s\n", flag, decision)
}
This is a contract preflight with a small scope. It needs an existing private object and an existing flag, not an assumed write payload. It reads metadata rather than downloading an artifact, so no presigned URL or storage access policy is changed. Its retry budget is bounded, it honors Retry-After on rate limits, and errors stop the preflight instead of silently authorizing a release. Production polling still needs fleet-level jitter and an overall deadline appropriate to the rollback budget.
Revision identity needs care: hashing a timestamp that changes on every metadata read would select a different flag each time. Use an immutable revision identifier established during artifact publication, and make its uniqueness contract explicit across buckets and environments. A missing field must block candidate admission. Never infer that an unrecognized response means enabled.
The alternative Neon or PlanetScale plus LaunchDarkly stack requires two provider signups and two sets of credentials for this seam. Your glue would map the database release identifier to the flag, coordinate publication and eligibility, and retain the record needed to reverse that association. A shared credential reduces that integration surface; it does not provide a transaction across storage and flag operations. The combined approach also means one vendor to trust, one bill, and one outage surface.
Verify rollback before widening the cohort
Start with a proposed 1% cohort and keep its assignment stable enough to compare quote behavior. The percentage is an illustrative release policy, not a claim about a provider's targeting fields. Implement cohort assignment in the application unless the verified flag contract provides the precise targeting semantics you need.
Before widening exposure, prove three things: the previous artifact still loads, a candidate quote records its revision, and disabling candidate eligibility causes every server to stop selecting it within the chosen rollback deadline. Check an already accepted quote separately. A system that recomputes that price during rollback has crossed the business boundary even if every flag response is correct.
Use your existing analytics to compare quote outcomes by revision. Instrument counters with bounded labels such as rule version and outcome; shipment identifiers, customer identifiers, and unrestricted flag keys are poor metric labels because they can create uncontrolled cardinality. Prometheus documents the cardinality concern, and the data minimization principle is another reason to keep quote evidence limited to what the release decision actually requires.
If the rollout fails its acceptance checks, stop new candidate admissions, restore selection of the previous artifact, and verify application decisions across the fleet. Observe until the maximum cached-decision age has elapsed, then inspect fresh quotes for the selected revision. This establishes an application-level rollback condition rather than equating a control-plane response with success. Keep an application release record of the intended change, operator, artifact identity, and verification result.
Keep the flag.
Deletion is cleanup, not rollback: without a recycle bin, deleting the control removes a useful recovery handle. Retire it only after the previous-rule retention window and reconciliation needs have been met, with an owner and an explicit review date. If that discipline or external analytics is more operational work than the team wants to own, revisit the managed feature platform decision before the next pricing release.
Top comments (0)