Plan Enforcement without a Rate Limiter – How Trnqify Keeps Free, Standard, and Pro Users in Check
Why plan enforcement matters for a high-growth SaaS
When you’re managing a product that scales across Free, Standard, and Pro tiers, every ounce of operational complexity costs you time you could spend shipping features. Trnqify is a privacy-first URL shortener built for marketers and developers who need analytics with built-in UTM tagging. The moment we opened a Pro plan for early customers, we realized the naïve “check-the-plan-field-and-allow” approach would break under even modest usage.
The solution had to be simple enough to maintain at scale, privacy-aware, and reliable enough that a free user can’t accidentally eat the quota of a paying customer. The result is a usage-identifier-driven enforcement model that lives entirely in the request pipeline and externalizes quota checks to our billing provider.
AI Disclosure: This essay was drafted with the help of Trnqify’s AI assistant (via the internal MCP server) to speed up copy-editing and generate the diagrams you’ll see below. The final voice is still entirely mine.
The privacy-first guarantee we built into every click
Trnqify’s redirect domains (trnq.io and any custom domains a Pro customer adds) are cookie-free. We deliberately avoid storing raw IP addresses; instead, we resolve a geo-location bucket (country, region, city) on the fly and discard the IP. Click records live for three years, after which they are automatically purged.
Because there are no client-side cookies or tracking pixels on the redirect, we can safely enforce per-plan limits without compromising privacy. The only piece of data that survives in our analytics store is the anonymized geolocation bucket and the link’s path.
Enforcing limits with usage-identifiers, not bucket-style rate limiters
Most SaaS products reach for a classic token-bucket or leaky-bucket algorithm. Those patterns require:
- A fast in-memory store (Redis, Memcached) to decrement counters.
- A background job to refill buckets on a schedule.
- Edge-case handling for bursts and partial failures.
For a high-growth operation, that stack is overkill. Trnqify instead leverages the usage-identifier-key that our authentication layer extracts from the authenticated session. The identifier is a stable string that maps 1-to-1 with a customer and, by extension, their plan.
When a request to create a link arrives:
- The request passes through the authentication layer, which injects
usageIdentifierKey. - The link-creation handler checks the current month’s click count for that identifier against the plan’s threshold.
- If the count exceeds the plan’s threshold, the handler serves a click interstitial (on free plans) or simply increments the metered usage for billing (on paid plans).
- No external rate-limiter is required; the “enforcement” is handled by user experience (the interstitial) or billing adjustments.
Because the counter lives in a single database item per customer, there’s no distributed state to synchronize and no per-request latency beyond a cheap read. This pattern scales linearly with the number of customers, not the number of clicks.

Note: The redirect handler itself does not enforce limits; it simply increments the counter asynchronously after the redirect completes. This guarantees that a user never sees a broken short link because a limit was hit mid-click.
Metered click tracking – what we actually bill for
Trnqify’s revenue model is a metered clicks tier on the Standard plan. Our billing provider handles the metering automatically:
- Each click increments a
usageQuantityon a usage record. - At the end of the billing period, the provider calculates the over-age fee based on the tiered pricing we configured (
$0.0001 per extra click). - The customer sees the usage in their billing portal; we surface a read-only view in the Trnqify dashboard.

Because the metering is performed by the billing provider, we avoid writing any custom invoicing logic. The only integration point is a background “report click” function that pushes a usage event to the billing API. If the click fails to report (network outage, background error), we retry via a queue, ensuring eventual consistency without impacting the redirect latency.
Trade-offs: simplicity vs. fine-grained control
| Aspect | What we gained | What we gave up |
|---|---|---|
| Operational overhead | No separate rate-limiter service, no Redis, no scheduled refill jobs | No per-second burst protection (but not needed for URL shorteners) |
| Privacy | No IP logs, no client-side tracking | Cannot identify abusive click patterns beyond aggregate city-level data |
| Scalability | Database auto-scales; single read per request | Slightly higher read latency vs. in-memory counters (≈ 2 ms) |
| Customer insight | Click totals per month are visible in billing portal | No real-time throttling dashboard (future work) |
For a professional team, the trade-off is worthwhile: the code base stays under 200 LOC for enforcement, and the only external dependency is billing.
Lessons for builders who prioritize reliability over complexity
- Leverage existing metered-billing services – A provider’s usage API is a hidden gem. It spares you from building a custom invoicing pipeline.
- Let the database be the source of truth – A single item per customer gives you atomic increment, expiry, and built-in durability.
- Keep the enforcement path linear – Authentication → plan lookup → counter read → decision. No branching, no side-cars.
- Make privacy a feature, not an afterthought – By design, we never store raw IPs; that eliminates an entire class of compliance work.
- Document every edge case – In our case, the redirect handler must never block on the counter, so we do the increment asynchronously. A short note in the code prevented a nasty production bug.
If you’re building a SaaS that needs tiered usage but you want to prioritize reliability, ask yourself: Do I need a full-blown token bucket, or can I piggy-back on my billing provider? For most “light-touch” products, the answer is the latter.
Next steps & a single CTA
Trnqify continues to iterate on plan enforcement. The next milestone is a real-time usage dashboard for paid customers, built on top of the same counters.
Ready to short-link with privacy-first analytics?
Sign up for Trnqify
(The link includes UTM tags so we can see how this post drives traffic.)
