Skip to content

Single Database ​

In the single database variant of the SaaS module, every tenant on the platform shares one database. All merchants' records sit in the same tables and are separated by a tenant identifier, so each merchant only ever sees their own store data.

What you'll learn

  • How tenant data is separated inside one shared database
  • When this variant is the right choice
  • What it means for setup, backups, and upgrades

How it works ​

Single shared database for all tenantsSuper admin panelTenant A storeTenant B storeTenant C storeBagisto SaaS platformdetects the tenant from the domain and filters every query by tenantOne shared databasePlatform dataTenant A rowsTenant B rowsTenant C rowssame tables — every row carries its tenant id
  • The platform runs on a single database connection for every tenant.
  • Each record — products, categories, orders, customers — carries the tenant it belongs to.
  • When a merchant opens their storefront or admin panel, the platform detects the tenant from the domain and automatically limits every query to that tenant's data.
  • A new merchant is provisioned instantly: no new database is created, only their tenant record and store data.

Advantages ​

  • Simple to set up and maintain — one database to configure, migrate, back up, and monitor.
  • Lower infrastructure cost — a single database server can host a large number of stores.
  • One-step upgrades — migrations and module updates run once for the whole platform.
  • Fast onboarding — tenants are ready to sell as soon as they register.
  • Platform-wide reporting — the super admin's cross-tenant views (customers, products, orders) read from one place. See Tenant Data.

Things to keep in mind ​

  • All tenants share the same database resources, so a very large store can affect others.
  • Backing up or exporting a single tenant means extracting that tenant's rows rather than copying a whole database.
  • Tenants cannot be moved onto their own database server individually.

Best for

A high volume of small and medium stores, where low cost and simple maintenance matter more than physical data separation. If tenants need strictly separated data or their own backups, use Multiple Databases instead.