Building a multi-tenant Link-in-Bio product can quickly lead to complex hosting setups. Here is how we managed multiple tiers on one shared backend.
By Team WebSync · · 3 min read

When launching a SaaS product, it is tempting to separate user tiers by hosting separate code deployments or spawning dedicated databases. While this provides isolation, it multiplies maintenance overhead by ten.
While building a link-in-bio platform for local vendors, we opted for a single shared backend codebase. Access to premium tools-like customized designs or native payment collections-is feature-gated at the logical level rather than the infrastructure level. This is the breakdown of how to make multi-tenancy boring and clean.
Instead of isolating databases, we used a shared database model where every table includes a tenant ID or user owner ID. A global middleware layer automatically scopes SQL queries to the current authenticated tenant's ID.
This prevents data leaks at the application entrypoint, making it impossible for one vendor to query or modify another vendor's layout or payment credentials.
We implemented a lightweight permission-check system. A user profile payload returned from the database includes a 'tier' field (e.g., 'free', 'pro', 'enterprise').
Every time an API route is requested, a middleware check queries the user's tier. If a free user attempts to enable custom CSS styling or configure a payment gateway, the server immediately rejects the request with an HTTP 403 Forbidden status.
function checkFeatureAccess(requiredTier) {
return (req, res, next) => {
const userTier = req.user.tier; // e.g. 'free'
const tiers = { free: 0, pro: 1, enterprise: 2 };
if (tiers[userTier] < tiers[requiredTier]) {
return res.status(403).json({
error: 'Feature locked. Upgrade required.'
});
}
next();
};
}Gating isn't just about turning features on or off; it's also about managing quotas. For example, a free user might be limited to 5 links, whereas a pro user gets unlimited links. We implement this by running aggregation counts before inserting records.
By performing a count query in the active write transaction, we guarantee that users cannot bypass their tier limitations by firing concurrent API requests.
When a subscription event triggers (e.g., user pays via payment gateway), we receive a secure webhook payload on the server. The webhook updates the tenant's tier column inside the users table.
Because the feature gates dynamically read the current database state, the tenant immediately gains access to their new features without needing any code redeployment or container restarts.
A SaaS with 10 infrastructure instances is 10 times harder to keep secure. Keep it singular and gate access at the logical layer.
Keep one shared database and codebase, scope every query by tenant ID through a global middleware, and check the user's subscription tier at the API-route level rather than deploying separate environments per plan. Webhooks update the tier field on payment events, so upgrades take effect immediately with zero redeploys.
Clean, format, parse, and validate JSON inputs with instant syntax lint warnings and code export.
Decode, verify, parse, and edit JWT token components including headers, payloads, and signatures.
Generate SHA-1, SHA-256, SHA-512, and MD5 cryptographic hash values for strings in real time.
Book a free consult - we'll scope it and give you a fixed price.