I've been building booking software for a while, and every project starts with the same conversation.

"They want online booking." Fine. "They have five staff, three rooms, and two locations." Still fine. "And the platform should let other shops sign up and run their own booking page under their own brand." That's the moment where the requirements stop being a calendar widget and start being a multi-tenant product.

I ended up building that product. It's called Skeduvo, and this post is about the three architectural decisions that shaped it: row-level multi-tenancy, generated time slots, and treating the customer booking page as an installable web app instead of a native app.

The stack

Layer Choice
Backend Java 21, Spring Boot 3.5, Spring Security, Spring Data JPA / Hibernate
Database MySQL 8 (utf8mb4)
Frontend Vue 3.5, Element Plus, Vite 6, vue-router, vue-i18n
PWA vite-plugin-pwa (Workbox)
Deployment Docker Compose, Nginx, MySQL 8.4

Nothing exotic. That was intentional. A booking product that a small team has to maintain for years should be boring on purpose.

Decision 1: row-level tenancy, not a database per tenant

There are three common ways to isolate tenants:

  1. Database per tenant — clean isolation, painful operations. Every migration has to run N times, and backups get complicated once you pass a few dozen tenants.
  2. Schema per tenant — better than a database each, but MySQL schema handling, connection pooling, and cross-tenant reporting still get awkward.
  3. Row-level with tenant_id — one schema, one connection pool, one migration. Isolation is enforced in the application layer.

I picked the third one. One installation, one MySQL database, many independent shops. Every tenant-scoped table carries tenant_id, and every query is filtered by it.

The important part is that "filtered in the application layer" has to be structural, not a convention that someone remembers to follow. In practice that means three things:

  • A ThreadLocal holding the current tenant, set once per request by an auth filter.
  • A Hibernate @Filter on every tenant-scoped entity, enabled automatically before queries run.
  • An explicit, auditable bypass for the platform admin, who genuinely needs to query across tenants.

The bypass is the part people forget. If your platform admin has to read all tenants, and your isolation is "always filter by the current tenant", then the admin panel either breaks or someone adds ignoreTenant() checks scattered through the codebase. Better to have one named bypass and a code review rule that nothing else uses it.

The entity side stays small — one annotation pair per tenant-scoped class:

@Entity @FilterDef(name = "tenantFilter", parameters = @ParamDef(name = "tenantId", type = Long.class)) @Filter(name = "tenantFilter", condition = "tenant_id = :tenantId") public class Booking { @Column(name = "tenant_id", nullable = false) private Long tenantId; } 

The public identifier matters too. Each tenant gets a slug — lowercase letters, numbers, hyphens — and that slug is the only tenant thing that appears in the outside world: booking links, embed snippets, emails. Tenants can't change it themselves, because it's baked into links that customers already have.

Decision 2: time slots are generated, not queried

This is the part that takes the longest, and the part most tutorials skip.

"Show available times" sounds like a query. It isn't. Availability is the result of a lot of rules interacting:

  • Weekly working hours per resource, and resources can be staff, rooms, or devices
  • Date exceptions for holidays, leave, and one-off special hours
  • A service duration, plus a buffer before and after each appointment
  • A minimum lead time, so nobody books a slot starting in ten minutes
  • A daily booking cap per resource, independent of the slot grid
  • Existing bookings, which consume capacity

If you compute all of that on every page load, you get a slow endpoint and inconsistent answers. So slots are materialized: a generator walks the schedules and exceptions, applies the rules, and writes concrete slot rows. The public availability endpoint then reads rows instead of recomputing.

The trade-off is that anything that changes the rules has to invalidate the generated slots. If an admin edits a schedule, disables a resource, unbinds a service, or deletes a shift, the affected future slots must be rebuilt or removed. Miss that and you get orphan slots leaking to the customer side — a slot for a service that no longer exists, or a person who no longer works that day.

Two rules saved me a lot of bugs:

  • Rebuild is automatic and debounced. Mutations publish an event; the generator reruns shortly after, and repeated edits inside a short window collapse into one run.
  • Cleaning happens even when nothing is generated. If the day has an exception or produces no new slots, the old unbooked slots for that day still get purged. Early on, a return in the wrong place meant disabled resources left their slots behind for weeks.

For the booking write path, capacity is protected with a row lock on the slot, plus an optimistic @Version on the booking itself, so two customers clicking the same last seat can't both succeed.

Decision 3: the customer side is a PWA, not an app

Every client asks for an app. Almost none of them should get one.

The customer booking flow is short: open a link, pick a service, pick a time, fill in a name and email, done. Shipping that as a native app means an app store review cycle and a download step before the customer's first booking. Shipping it as an installable web app means the link works immediately, and the customer can add it to their home screen if they book often.

What it took to make that feel native:

  • A web app manifest served per tenant, so the installed icon opens straight into that shop's booking page, with the tenant's name and theme color
  • 192/512 px icons and a maskable icon, cached by the service worker so the shell opens offline
  • The manifest's id field pinned per tenant, otherwise Chrome treats each tenant's manifest as a separate app and you get duplicate icons on the home screen
  • API responses deliberately not cached — availability and booking submission always need a live connection
  • An explicit update prompt, so a new deployment never reloads the page while someone is halfway through a booking form

The manifest is generated per request, so the installed app carries the tenant's identity rather than the platform's:

{ "id": "/book/my-salon", "name": "My Salon", "short_name": "My Salon", "start_url": "/#/book?slug=my-salon", "display": "standalone", "orientation": "portrait", "theme_color": "#2f6fed", "background_color": "#ffffff" } 

The last point matters more than it sounds. Most PWA tutorials tell you to call skipWaiting() and reload immediately. For a form-heavy flow, that's a way to lose a customer's work.

What I deliberately left out

Booking and scheduling is the product. Payments, subscriptions, invoices, tax, SMS, and push notifications are not in it, and I'd rather say that plainly than let a buyer discover it after purchase.

The reason is scope. Payment processing alone is a compliance project: tax rules per country, refunds, chargebacks, SCA in Europe, and a payment provider's risk team asking questions about your business model. Bolting a half-finished Stripe integration onto a booking engine makes it worse for everyone.

Wrapping up

Three decisions, and most of the complexity lives in the second one:

  • Row-level tenancy keeps operations simple, at the cost of discipline in the application layer.
  • Generated slots make availability fast and consistent, at the cost of a real invalidation strategy.
  • A PWA makes the customer flow instant, at the cost of accepting that you can't do background push without extra work.

If you want to see the result, there's a live demo where you can create your own empty workspace from the sign-up page and click around. The full source is a one-time licensed purchase, with the backend and frontend both readable — no obfuscation, no license server, no domain lock.

Happy to answer architecture questions in the comments.