Zum Hauptinhalt springen
AI & KI NachrichtenGitHub Release: openai/codex vrust-v0.163.0 (15.10.2026)(15.10.2026 um 20:57 Uhr)
•
IT Security DownloadsGitHub Release: anthropics/claude-code v2.1.301 (15.10.2026)(15.10.2026 um 21:22 Uhr)
•
IT Security DownloadsGitHub Release: anomalyco/opencode v1.19.1 (15.10.2026)(15.10.2026 um 21:19 Uhr)
•
Sichere ProgrammierungGitHub Release: Devolutions/UniGetUI v2026.3.2 (15.10.2026)(15.10.2026 um 20:58 Uhr)
•
IT NachrichtenMoD’s new SIEM, analytics platform up and running(15.10.2026 um 16:59 Uhr)
••••
AI & KI NachrichtenFTC subpoenas OpenAI and Anthropic following safety failures(15.10.2026 um 21:28 Uhr)
••
AI & KI NachrichtenGitHub Release: openai/codex vrust-v0.163.0 (15.10.2026)(15.10.2026 um 20:57 Uhr)
•
IT Security DownloadsGitHub Release: anthropics/claude-code v2.1.301 (15.10.2026)(15.10.2026 um 21:22 Uhr)
•
IT Security DownloadsGitHub Release: anomalyco/opencode v1.19.1 (15.10.2026)(15.10.2026 um 21:19 Uhr)
•
Sichere ProgrammierungGitHub Release: Devolutions/UniGetUI v2026.3.2 (15.10.2026)(15.10.2026 um 20:58 Uhr)
•
IT NachrichtenMoD’s new SIEM, analytics platform up and running(15.10.2026 um 16:59 Uhr)
••••
AI & KI NachrichtenFTC subpoenas OpenAI and Anthropic following safety failures(15.10.2026 um 21:28 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Killing à-la-carte: migrating a feature-gating model to plans-only

TL;DR Moved a SaaS from à-la-carte feature subscriptions (pay per feature) to plans-only (pay for a tier, get its features). Did it in four phases so nothing …

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!




TL;DR




  • Moved a SaaS from à-la-carte feature subscriptions (pay per feature) to plans-only (pay for a tier, get its features).

  • Did it in four phases so nothing broke mid-flight: seed plans → gate on plans → migrate orgs → delete the old machinery.

  • Lesson: model migrations are safest as expand → migrate → contract, not a big-bang swap.






The problem



The old billing let an org subscribe to individual features à la carte. Flexible on paper, painful in practice: entitlement logic had two sources of truth (per-feature subscriptions and an implicit plan), and every gate had to check both. Time to collapse it into one model — you buy a plan, the plan carries the features.



The trap with this kind of change is the temptation to rip out the old columns and ship. Do that and every in-flight subscription, every gate check, and every webhook that still speaks the old language breaks at once.






The phased plan



I ran it as four ordered migrations. Each phase is deployable on its own and leaves the app working.

































Phase What it does Why this order
F1 Seed Plans into the prerequisite chain New model must exist before anything reads it
F2 Gate features on the plan, not the feature-sub Reads switch over while writes still dual-run
F3 Deploy op migrates existing orgs onto a plan Backfill — nobody left on the old model
F4 Remove the à-la-carte machinery Contract — safe only after F3


This is the expand/contract pattern applied to a domain model, not just a schema. Expand (F1) adds the new thing alongside the old. Migrate (F2–F3) moves reads then data. Contract (F4) deletes the old thing once nothing points at it.




  F1 seed        F2 gate on plan     F3 backfill orgs    F4 drop features
┌────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ plans │ --> │ reads: plan │ -> │ every org on │ -> │ delete a-la- │
│ exist │ │ writes: both │ │ a real plan │ │ carte code │
└────────┘ └──────────────┘ └──────────────┘ └──────────────┘
safe safe safe safe









Gating on the plan



The gate collapses to a single question: does this org's plan grant the feature? One entitlement resolver instead of two.




final class EnsureFeatureAccess
{
public function handle(Request $request, Closure $next, string $feature)
{
$plan = $request->user()->organization->currentPlan();

abort_unless($plan?->grants($feature), 403, 'Upgrade required.');

return $next($request);
}
}






Two edge cases worth calling out. Metered features (email sends, certificate issuance) aren't just on/off — the plan grants a credit balance, so the gate checks remaining quota, not just entitlement. And internal orgs (superadmin-owned) get the top tier granted permanently, so ops tooling never trips the paywall.






A note on the payment edge cases



Migrating billing surfaced the usual payment-gateway papercuts: an order reference that exceeded the gateway's 30-char cap, a null payer phone that failed checkout for every paid org, and validation errors that were swallowed instead of surfaced. None are glamorous — but a billing migration is exactly when they bite, because every org is re-subscribing at once.






Testing the gate



The behaviour worth pinning: no plan → blocked; plan that grants it → allowed.




it('blocks a feature the plan does not grant', function () {
$org = Organization::factory()->onPlan('starter')->create();

actingAs($org->owner)
->get('/reports/advanced')
->assertForbidden();
});

it('allows a feature the plan grants', function () {
$org = Organization::factory()->onPlan('business')->create();

actingAs($org->owner)
->get('/reports/advanced')
->assertOk();
});









Takeaway



When you're changing how entitlements work, treat it like a schema migration even though it's business logic. Expand, migrate reads, migrate data, then contract — one deployable phase at a time. The four-migration overhead is cheap next to a billing outage where nobody can access what they paid for.

Intelligence Digest — kostenlos Täglich die wichtigsten Security-News · jederzeit abbestellbar
Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War diese Seite hilfreich?
0
Jetzt Bewertung abgeben
🟢 Niedrig (1-3.9) 🟡 Mittel (4.0-6.9) 🔴 Hoch (7.0-8.9) Kritisch (9.0-10.0)

Verwandte Story-Cluster & Quellen (Vektor-KI)

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Killing à-la-carte: migrating a feature-gating model to plans-only

Thematisch verwandte Begriffe: Killing, àlacarte, migrating, featuregating · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag