Back to blog

Fixing the Availability Problem in Scaling Scheduling Systems

As booking platforms grow, availability becomes a bottleneck. This article examines common design pitfalls and presents a more scalable, cache-friendly approach to availability modeling.

Tuong Dau avatar
Tuong Dau
6 min read

Scheduling systems look deceptively simple, but they’re actually not. 

To users, it’s just a calendar with a few available time slots. To a business, it’s revenue flow, utilization efficiency, and customer trust. To engineers, it’s one of the fastest ways to accumulate silent operational debt.

Building a reliable booking system isn’t easy because every business has its own way, such as how cancellations or rescheduling are handled. Thus, even a small mistake in the setup can affect the entire business and create a poor experience for users. 

Here is how we redesigned scheduling logic to be high-performance, flexible, and ready for hyper-growth.

Hidden Architecture Challenges of a Booking System

Availability Calculation

When calculating availability, the system needs to figure out how many available slots there are for a specific day. If an existing booking is canceled or rescheduled, the system must automatically recalculate the availability and update it with the newest information for the next users. This becomes more complicated when each booking has a different duration.

In other words, availability is not stored; it is derived.

To make it easier to imagine, let’s look at a common scenario:

In a workplace, there are many staff members, and each person has a different working schedule. On top of that, every staff member is responsible for a different skill or service. So when a user wants to book a meeting with a staff member for a specific skill, the system needs to check several things:

  • The working hours of the workplace

  • The working hours of that staff member

  • Whether that staff member provides the skill the user needs

  • How long the meeting for that skill will take

  • Whether the staff member is already busy with another meeting

Below is a diagram to help you understand the logic better:

Booking System Logic.jpg

Availability Optimization

The next factor to think about is optimization. When the system becomes bigger, and especially when we add new features, we need to make sure it’s still easy to update. 

For example, maybe in the beginning, the system only allows working hours like 08:00, 08:10, 08:20. But later, the business wants more detailed times like 08:05, 08:10, 08:15.

If the system is not built in a flexible way, it will not be possible to change to these smaller time intervals. Making this update will be very difficult and will take a lot of development time. In the worst case, the team may need to rebuild the whole availability logic again.

Besides meeting the current requirements, the system should also allow new features to be added easily, without too much effort. We want to be able to build new functions on top of the existing system, not rebuild everything again.

Read Heavy

Finally, system performance can become a critical concern, especially under high traffic.

In most booking systems, the dominant workload is read-heavy. The system repeatedly reads data to calculate availability for users. As the dataset grows, reading it directly from the database can be slow and can result in a bottleneck in the database layer.

To address this, caching is essential. Availability data should be stored in cache and served directly whenever possible. 

However, caching alone is not enough; the availability data structure itself must be designed carefully. This is so the system needs to return accurate, up-to-date availability from cache without introducing additional computation overhead or consistency issues.

Time Handling in the System

❌ Approach 1: Treat Time as DateTime Ranges

Some systems save time as DateTime type in the database. When calculating available slots, the system uses text comparison to find overlapping times.

For example:

  • If a place operates from 08:00 to 17:00 as regular working hours and a certain resource is available from 10:00 to 17:00, the system compares “10:00” > “08:00” and calculates that the available range is from 10:00 to 17:00.

  • If one booking already exists from 10:00 to 11:00, and the service duration needs 15 minutes, the system must detect overlapping times and exclude them, and it should show new availability from 11:00 to 16:45.

Approach 1 Example

While this DateTime type-based approach can work in the beginning, it quickly becomes complex and hard to maintain as the system grows, since every check depends on comparing and filtering time strings.

✅ Approach 2: Save Time as Blocks

We found a simpler way: convert time to numbers.

  • We split the day into small “blocks.”

  • 1 block = 5 minutes (or X minutes, depending on our business logic).

  • A full day = 24 hours × 60 ÷ 5 = 288 blocks.

So:

  • 00:00 → block 0

  • 00:05 → block 1

  • 00:10 → block 2

  • 23:55 → block 287

Approach 2 Example

Example of booking a meeting room:

  • Regular working hours for the office: 08:00–17:00 → block 96 to 204

  • Existing booking: 08:00–09:00 → block 96 to 108

  • Resource duration (meeting duration): 30 minutes = 6 blocks

Steps to calculate availability:

  • Remove the booked time blocks (from 96 to 108) from working hours of the office (from 96 to 204) → remaining free time is 108 to 204.

  • For each free block, check if there’s enough continuous space for the new duration (need 6 blocks for a resource duration)

Final result: available blocks are 108 → 198 → 09:00–16:30

Why approach 2 is more future-proofed:

  • Granular Precision: You can define each block as 5, 10, or 15 minutes. This flexibility allows the system to fit various booking needs. For example, a 15-minute service won’t be rounded up to 20 minutes. In this case, the system does not waste time. It can even support minute-by-minute when needed.

  • Seamless Scalability: Because time is stored in numbers, the system becomes more adaptable and easier to expand. Adjusting or updating the duration logic is also simpler than when using text. It’s easy to update the time interval from 10 minutes to 5 minutes, or even 1 minute.

  • High-Performance Caching: With storing availability in DateTime type in cache, caching can be complicated and resource-intensive, but when data is stored as numbers, caching becomes lighter and faster. Accessing and processing numeric blocks is also quicker and easier when new features are added.

  • Simplified Logic: This approach not only simplifies availability calculations but also makes the whole system faster, more flexible, and easier to maintain as it grows.

Wrap Up

A smart scheduling system isn’t just about putting an event on a calendar; it’s about availability optimization. By converting time into blocks, we’ve built a system that is faster for users, easier for developers to maintain, and flexible enough to support any business model, from coworking spaces to global telehealth platforms.

Is your current scheduling infrastructure holding back your product's growth?

Senior Software Developer

Tuong Dau

Senior Software Developer

Tuong Dau is an accomplished Full-Stack Developer with around 9 years of experience, specializing in JavaScript and TypeScript for both Front-end and Back-end development. He has a strong command of Front-end technologies like ReactJS / NextJS and Back-end frameworks such as NodeJS / NestJS, allowing him to deliver high-quality, scalable applications across the full technology stack.

Related articles

Explore our blog
avatar-blog

Lessons from Our CMS Migration to Strapi

Bao Tran avatar

by Bao Tran

avatar-blog

The Human Truths of Database Migration

Hiep Dinh avatar

by Hiep Dinh

avatar-blog

Strategies and Tools for Effective Time Zone Management in Software Development Collaborations

Marketing Team avatar

by Marketing Team

Let's discuss your project needs.

We can help you get the details right.

Book a discovery call
background

CodeLink Newsletter

Subscribe to receive the latest news on technology and product development from CodeLink.

CodeLink

CodeLink empowers industry leaders and innovators to build high-impact technology products, leveraging AI and software development expertise.

Contact Us

(+84) 2839 333 143Write us at hello@codelink.io
Contact Us
2026 © CodeLink Limited.
All right reserved.
Privacy Policy