Building a Multi-Tenant Marketplace from Scratch
At Linkcie, we let users launch production websites in under 10 minutes. Here's the architecture that made instant multi-tenancy possible.

Linkcie was a marketplace platform that connected local businesses across major U.S. cities. The core value proposition was speed: a business owner could sign up and have a fully functional website — with their own branding, product listings, and payment processing — in under 10 minutes. The architecture behind this required rethinking how web applications are structured.
The onboarding flow was the product's most critical user journey. We designed a five-step wizard: business name, category selection, template choice, content upload, and payment setup. Each step was designed to take under two minutes. Behind the scenes, step one provisioned the tenant record and initialized the database schema. Step three pre-populated content from category-specific templates — a restaurant got sample menu items, a salon got service listings. By the time the user reached step five, their website was already live with placeholder content, making the setup feel instantaneous.
“At Linkcie, we let users launch production websites in under 10 minutes. Here's the architecture that made instant multi-tenancy possible.”
Traditional multi-tenant systems use either database-per-tenant (expensive, hard to maintain) or shared database with tenant IDs (cheaper, risk of data leaks). We chose a hybrid: shared database tables with strict tenant isolation enforced at the query layer. Every database query automatically included a tenant filter, implemented through a middleware layer that was impossible to bypass.
Data isolation went beyond query-level filtering. We implemented row-level security at the application layer with automated audit logging. Every data access was logged with the authenticated tenant ID, and a nightly audit job compared access logs against tenant ownership records. Any discrepancy triggered an immediate alert. We also enforced tenant isolation in our test suite — integration tests verified that queries with one tenant's credentials never returned another tenant's data, and this test suite ran on every deployment.
The instant website feature used a template composition system. Instead of rigid themes, we built a section-based page builder. Each section (hero, product grid, testimonials, contact form) was an independent component. Users assembled their page by selecting and ordering sections, each with customizable content and styling. This single system supported 50+ business categories without category-specific code.
Payment processing was per-tenant, which added significant complexity. Each business needed their own Stripe Connect account for receiving customer payments, with our platform taking a percentage fee. The onboarding wizard included Stripe's OAuth flow, which authenticated the business owner and set up their connected account. We handled split payments through Stripe's destination charges — the customer paid our platform, and Stripe automatically split the funds between the business and our platform fee. Refunds, disputes, and payouts all had to be routed to the correct connected account.
The 'hot-swappable' theme engine allowed businesses to change their entire visual identity with zero downtime. Theme switches were instantaneous because styling was separated from structure — the HTML structure stayed the same, only CSS variables changed. We pre-compiled multiple theme variants and served them through a CSS class swap, ensuring no flash of unstyled content.
Each tenant received their own analytics dashboard showing traffic, conversion rates, popular products, and revenue trends. The analytics system ingested event data from a shared event stream, partitioned by tenant ID. We used materialized views in MySQL to pre-compute common analytics queries — daily revenue, weekly visitor counts, monthly conversion rates — so dashboards loaded instantly. The challenge was keeping materialized views fresh without impacting the production database; we solved this by running the refresh jobs against the read replica during off-peak hours.
Scaling was the constant challenge. Adding a new city meant more businesses, more traffic, and more data — but not proportionally more revenue per server. We optimized aggressively: aggressive caching at every layer (database query cache, rendered page cache, CDN), lazy loading for images and non-critical sections, and connection pooling to handle burst traffic during local events.
Our deployment pipeline had to support zero-downtime updates across all tenants simultaneously. We used blue-green deployments with a load balancer that gradually shifted traffic from the old version to the new. Database migrations were the hardest part — schema changes had to be backward-compatible because both old and new application versions coexisted during the transition window. We adopted an expand-contract migration pattern: first add new columns or tables (expand), deploy the new application version, then remove deprecated structures (contract) in a subsequent release.
The system maintained 99.9% uptime across three years while growing from Los Angeles to New York and supporting consistent month-over-month growth. The key insight: for a multi-tenant platform, reliability is the feature. If one business's website goes down, they blame us, not the internet. Every architecture decision was filtered through 'what happens to all tenants if this fails?'
The most counterintuitive lesson from building a multi-tenant platform was that customization is the enemy of maintainability. Early on, we accommodated per-tenant feature requests — a custom checkout flow for one business, a special inventory layout for another. Within six months, we had a spaghetti of conditional logic checking tenant IDs. We eventually rolled all customizations into the core template system, replacing if-statements with configurable components. The rule became: if one tenant needs it, build it as a feature available to all tenants. This discipline simplified the codebase dramatically and often surfaced features that other tenants didn't know they wanted.
Linkcie was a marketplace platform that connected local businesses across major U.S. cities. The core value proposition was speed: a business owner could sign up and have a fully functional website — with their own branding, product listings, and payment processing — in under 10 minutes. The architecture behind this required rethinking how web applications are structured.
The onboarding flow was the product's most critical user journey. We designed a five-step wizard: business name, category selection, template choice, content upload, and payment setup. Each step was designed to take under two minutes. Behind the scenes, step one provisioned the tenant record and initialized the database schema. Step three pre-populated content from category-specific templates — a restaurant got sample menu items, a salon got service listings. By the time the user reached step five, their website was already live with placeholder content, making the setup feel instantaneous.
Traditional multi-tenant systems use either database-per-tenant (expensive, hard to maintain) or shared database with tenant IDs (cheaper, risk of data leaks). We chose a hybrid: shared
...
Tags: Architecture, Multi-tenant, SaaS, PHP
See Also:
→ The Five-Word Quiz That Fills an Empty Deck on Day One→ AI Agents Are Replacing the Traditional Software Development Lifecycle→ PostgreSQL vs Firestore: A Practical Decision Framework→ How GenAI Reduced Our Operational Overhead by 90%→ Building a Production Image Pipeline with AWS S3Browse all articles →Key Facts
- • Category: Dev
- • Reading time: 14 min read
- • Technology: Architecture
- • Technology: Multi-tenant
- • Technology: SaaS