Serverless economics came with a UX tax: a Lambda that hasn’t run recently takes extra seconds to respond, and a booking flow that stalls at payment is a booking that doesn’t happen.
I attacked it from three sides. Functions were split per domain so hot paths stayed small — the booking function ships without the admin panel’s dependencies. Bundles were trimmed until cold init was dominated by the runtime, not my code. The app hides the remainder: optimistic UI on booking steps and prefetching the next step’s data while the user is still picking a time slot.
The result is a flow that completes in under two minutes on average, on infrastructure costing an estimated ~60% less than the equivalent always-on setup at the client’s traffic level.