Members book instantly, even when the finance system stalls

A gym group’s member portal, app and staff CRM all depend on a finance system that slows to a crawl under load. We built a layer in front of it that keeps members booking instantly while the finance system catches up.

Client
Gym group
Sector
Health & fitness
Kind of work
OpsMobile

The situation

The client runs a member portal, a mobile app and a staff CRM for its gyms. An ERP holds the financial record and cannot be bypassed. Under load, one pricing call slowed past ten seconds, and some calls timed out.

What made it hard

Members expect a booking to go through at once. The finance system has to agree with every booking, and it is slow and sometimes unavailable.

What we did

  1. Built a Laravel middleware between the portal, the app, the gym databases and the ERP, so the ERP’s formats are translated once, in one place, and never leak into the product.
  2. Added a circuit breaker: after repeated failures, the middleware stops calling the ERP for a short time instead of stacking up timeouts.
  3. Served cached data while it refreshes in the background, so members get fast answers that are only moments old.
  4. Made bookings optimistic. A booking saves at once, a queued job confirms it with the ERP and retries on failure, and if the ERP refuses, the booking undoes itself and the member is told.
  5. Added live seat counts, booking limits and automatic promotion from the waiting list.
  6. Made the portal lighter by cutting most of its CSS and JavaScript.

Before and after

What made it hardWhat we built
The ERP slowed past ten secondsA circuit breaker and cache in front
Bookings waited on the ERPSaved at once, confirmed in the background
The ERP could refuse a bookingAutomatic undo, and the member is told

What we would do differently

We measured the ERP carefully before the change. On every integration since, the measurement after the change is part of the definition of done, so the improvement is on paper, not a feeling.

Built with

Laravel · PHP · ERP integration · Queues · Flutter

Ready to build something great?

Tell us what’s breaking, or what you need built. You talk to the engineer who does the work.