5 min read

Lessons from building SaaS platforms

Lessons from shipping SaaS in beauty, retail and B2B: multi-role design, mobile plus API, tenancy, performance budgets and what to postpone in v1.

SaaS product architecture diagram with web, mobile clients and a shared API backend.

SaaS looks clean in pitch decks: one product, many customers, recurring revenue. In engineering it is a pile of sharp edges — roles, tenancy, mobile release trains, billing edge cases and the eternal temptation to build features before the core loop works.

These are lessons from building and extending real SaaS systems (booking platforms, POS-adjacent tools, B2B marketplaces), not a generic “startup playbook.”

Advertisement

1. Model roles before screens

Beauty and wellness SaaS taught me this early. Clients book. Partners manage availability. Admins oversee the network. If you design screens first, you invent three overlapping permission systems. If you design roles and resources first, the screens become projections.

Write down:

  • Who creates the business entity?
  • Who can see PII?
  • Who can cancel a booking and who gets notified?
  • What can a staff member do that an owner cannot?

Those answers belong in the API. The apps only reveal buttons.

2. Mobile and web are clients, not copies of each other

Shipping IZYA-style client and partner apps to the App Store and Google Play means Expo/React Native release discipline: build numbers, store review delays, push notification certificates, deep links.

Do not try to share navigation trees with Next.js. Share:

  • API contracts and TypeScript types
  • validation schemas
  • design tokens where practical

Keep navigation, gestures and offline behaviour native to each platform.

3. Multi-tenancy is a security feature

Every query that can accept a businessId from the client is a potential cross-tenant bug. Resolve the tenant from the authenticated membership, then filter. Add automated tests that attempt cross-tenant access on every new resource.

This is dull work. It is also the difference between a trustworthy B2B product and an incident report.

4. Make the core loop boringly reliable

For booking SaaS the loop is: discover → book → remind → complete → review.
For marketplace SaaS: discover → request quote → negotiate → fulfill.
For POS: scan/select → pay → sync stock → report.

Until that loop is fast and correct under load, chat widgets and AI assistants are decoration. Instrument the loop with timings and failure rates before you celebrate feature count.

5. Performance budgets beat micro-optimisations

Examples that mattered in practice:

  • Index the queries your home screens actually run
  • Avoid N+1 populates on list endpoints used by mobile
  • Compress images before they hit mobile networks
  • Cache session and permission lookups (with invalidation)

I have spent days shaving bundle kilobytes while a missing index wasted hundreds of milliseconds per request. Profile the API under realistic payloads.

6. Deploys are part of the product

SaaS customers notice downtime more than your changelog. Separate deployable units when possible (API vs marketing site vs workers). Use health checks, digest-pinned images and rollback paths. My blue-green Docker/nginx write-up exists because “just docker compose restart” is not a strategy once people book appointments during lunch hour.

7. Postpone cleverness

Things I no longer put in v1:

  • Custom workflow engines for one client
  • Premature microservices (a modular monolith is enough for most early SaaS)
  • Real-time everywhere (poll first; upgrade paths that hurt)
  • Multi-region active-active

Things I do put in v1:

  • Audit logs for destructive actions
  • Role checks with tests
  • Backups and restore drills
  • Feature flags for risky rollouts

8. Communicate constraints as product decisions

In Algeria and across remote teams I work with, internet quality, payment rails and store review times are constraints. Good SaaS engineering surfaces those constraints early: offline-tolerant screens, clear pending states, SMS fallbacks when push fails.

Onboarding the second tenant (where multi-tenancy breaks)

The first tenant is hand-tuned and forgiving. The second tenant exposes every shortcut:

  1. Provision flow: owner signs up → business entity → default roles → invite staff — each step should be idempotent and audited.
  2. Data defaults: timezone, currency, notification language, business hours — copy from tenant one’s defaults in code and you will ship wrong assumptions.
  3. Isolation check: before calling onboarding “done,” run your cross-tenant tests against the new business ID on every resource you added for tenant one.
  4. Support visibility: support staff need a safe “view as business” mode with logging, not shared admin passwords.

If tenant two requires manual SQL, you do not have onboarding — you have a services company wearing a SaaS T-shirt.

Feature flags: useful, easy to abuse

Flags helped ship risky booking rules and payment tweaks without a Friday deploy panic. Rules I follow:

  • Default off in production until a named owner toggles on for a tenant or percentage.
  • One flag, one behaviour — avoid if (flagA || flagB || clientId === 7) spaghetti.
  • Expiry dates in code comments or ticket — stale flags become undeletable mystery branches.
  • No secrets in flag payloads — configuration belongs in env or tenant settings, not LaunchDarkly JSON with API keys.

When not to flag: core tenancy checks, authz, or pricing logic you are “trying out.” Those belong in reviewed code with tests, not runtime toggles.

Observability minimums (before you call v1 live)

You do not need a full SRE stack on day one. You do need:

SignalMinimum
ErrorsUnhandled exceptions with requestId, route, tenant id
Latencyp95 for list + book (or your core loop endpoints)
SaturationDB connections, queue depth if you use workers
SyntheticOne cron or uptime check that hits /health and a read-only happy path

Alert on SLO breaches you can act on — booking failures for 5 minutes, not every 404 from scanners. Pair with blue-green deploys so you can roll back when metrics move.

Support triage in multi-role apps

Beauty and marketplace SaaS generate tickets that look like bugs but are permission misunderstandings. A simple triage order saved us repeated fire drills:

  1. Which role? client, partner staff, business owner, platform admin — reproduce under that role.
  2. Which tenant? confirm businessId on the session, not the ID pasted from a screenshot.
  3. API or UI? check the network trace; half of “button missing” reports are 403s with a generic mobile error.
  4. Deploy window? correlate with a release; if yes, feature flag off or rollback before debugging logic.
  5. Data or code? one bad row in production teaches you to log destructive admin actions early (audit logs in v1, not v3).

Escalate to engineering only after steps 1–3; escalate to product when the same question hits support three times in a week — that is a UX gap.

Closing

Scalable SaaS is mostly clear tenancy, a reliable core loop, honest APIs and calm deploys. Frameworks change. Those responsibilities do not. If you get them right, you can change React for something else later. If you get them wrong, no framework will save the rewrite.