When a room is sold at the front desk, every booking site must hear about it fast. If one site still shows the room, it can sell it again, and now two guests hold one room. This part explains how a PMS should work out and send room counts, so that never happens. It is the design we use after several years of getting it wrong in small ways.
The PMS decides, the channel manager copies
There must be one place that knows the true count. For a hotel with a PMS, that is the PMS. It knows every booking, every room taken out for repair and every room held for a group.
The channel manager and the booking sites only copy the number. If they ever disagree with the PMS, the PMS is right and the copy needs fixing.
The count itself is simple:
Never let it go below zero. Some hotels also want to type a lower number by hand, for example to keep two rooms back for walk-ins. Allow it, but record who typed it, and when it ends.
Record the change with the booking
This is the part most systems get wrong. A booking is saved, and then the code calls the channel manager. If that call fails, or the server restarts between the two steps, the booking exists and the channel manager never hears about it.
The fix is to never call the channel manager from the booking code at all. Instead, write a small note in your own database, in the same step as the booking: "nights 10 and 11 March changed for Deluxe". Engineers call this an outbox.
Because the note and the booking are saved together, there is no gap. Either both are saved or neither is. Every action that changes a count does the same: a booking, a cancel, a change of dates, a room block, a hold, a hand-typed number.
One sender, working out the count when it sends
A separate worker reads the notes and sends the counts. We call it the drain. It is the only code allowed to send room counts.
Two details matter:
- It works out the count at the moment it sends. It does not send the number from the note. Ten bookings in a second become one send with the latest number.
- It takes one hotel at a time. Two senders working on the same hotel at once can send an older number after a newer one.
The drain starts as soon as a change is saved. It also runs every minute as a backstop, and it picks up anything a previous run left half done.
Send ranges, and only what changed
A channel manager accepts only a limited number of updates for each property. The connectivity provider we use allows about 10 room count updates a minute for each property. Sending one night at a time wastes that budget fast.
So group the nights into ranges. If Deluxe has 3 rooms left on every night from 10 to 20 March, that is one value, not eleven. We send up to 500 values in one update.
Worked example
A group booking
In this example, a group books 4 Deluxe rooms for 10 to 13 March. The hotel had 6 left on each night.
The booking writes notes for 10, 11 and 12 March. The drain works out 2 for each night and sends one range: Deluxe, 10 to 12 March, 2 rooms. One update, not three.
Also send only what changed. Every night of the year, for every room type, is thousands of values. A live change, such as a booking, is always sent. A regular full check sends a night only if the count differs from what the channel manager last held.
Closing comes first
Not every update is equal. Closing a room that is sold out must never wait behind a price update for next year.
Give updates that lower or close room counts the first place in line. If the update budget runs out, a close still goes through. A hotel would rather miss a sale than sell a room it does not have.
Check what the channel manager really holds
Sending a number is not the same as the channel manager holding it. A call can return "success" and the value can still be refused or changed later.
So read back. Once a night we compare what the channel manager holds with what the PMS says, and send again where they differ. We also keep a record of what each booking site was last seen holding, so "unchanged" means "seen", not "sent once".
Sent is not the same as held. Read back, and send again where it differs.
When sending fails
Sending will fail sometimes. The channel manager is down for a few minutes, or the network drops.
- Keep the notes until the send succeeds. A failed send is retried, never dropped.
- Wait a little longer after each failure, so you do not flood a service that is already struggling.
- After five failures in a row, mark the hotel as out of sync, show it on screen and email a person.
Show the hotel a simple status: in sync, waiting to send, or out of sync. Hotel staff should never have to guess.
- The PMS is the one place that knows the true room count.
- Every change that moves a count writes a note in the same database step.
- One sender sends room counts, one hotel at a time.
- The sender works out the count when it sends, not when the note was written.
- Nights are grouped into ranges, and only changes are sent.
- Closing updates go first.
- You read back what the channel manager holds, at least once a day.
- Failures are retried, and a person is told when they keep failing.
What to check in your own system
- No code calls the channel manager from inside a booking.
- A test fails when new code changes a count without writing the note.
- You can show, for any night, what you sent and what the channel manager holds.
- Your updates stay well inside the channel manager's limit on a busy day.
- A hotel can see its sync status without asking you.
For more on the update limits, read our post on the channel manager API. Part 3 explained room counts, prices and rules. Part 9 looks at how booking sites work from the inside. See our channel manager for the product.
