Best Practices

Developing

The Cache API – Scan Service has been designed in order to support multiple versions of the specification structures. The version you support will be configured in the HotelBeds client configuration.

In spite of the version management, it is very important that your process algorithm supports adding new fields or new structures in the availability output file and inventory output file.

The new fields will be always added at the end of the line, i.e.: 

14:PMI:1519:1:E10:56921:NEW_FIELD
 

Creating ScanPlans

Request configuration: 
We recommend to create one single ScanValuedAvailRQ for each destination you want to scan instead of create a single request with all the scan plans inside. 

For example: if you create a ScanValuedAvailRQ with hotel codes only, you should group these codes into multiple requests grouped by hotel destination. 

We recommend that, in the same request:

  • one destination
  • the distribution of occupancies not exceeding 5 combinations (HotelOccupancyList/Ocupancy)
  • the length of stays not exceeding 7 combinations (LengthsOfStay/LengthOfStay). Please try not to send huge lengths of stay (20,21,22,23,24,25,26 y 27…) as these requests can overload your system
  • the duration of the period from 30 days and does not exceed 180 days (Date@duration). If more durations needed, please send another scan plan with the same durations (90 or 180) until you cover your whole duration (for example 180 + 180 or 90 + 90 + 90 + 90 for 1 year)
  • if there is necessity to filter by hotel, throw the request by destination (as always) and use your hotel list to filter. The timing will be reduced in this way
  • you should not throw the same request from the same destination and same hotels concurrently, as is going to give you the same result


The main reason is because the result will be bigger, the generation time higher and increase your process time. 

Incremental mode: 
It must be clear whether it is necessary to work in incremental mode because this mode generates additional structures which make processing times are increased relative to
non-incremental mode.

Metrics example

The following metrics has been executed with the following parameters:

  • Server (Linux Red Hat)
  • 4 CPU's 32-bits
  • 4 GB RAM


Requests executed sequentially

Destination

Hotels

Duration

Hotel Occupancy List

Lengths of stay

File size (MB)

Ouput file lines

Time (minutes)incremental: NO

Time(minutes)incremental: YES

PMI

562

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

182

1.118.740,00

5,26

6,35

LON

429

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

246

1.529.460,00

5,51

7,17

PAR

601

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

265

1.626.388,00

8,31

9,44

CUN

123

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

139

745.031,00

3,30

4,90

 

 

 

 

 

 

Total:

22,38

27,86



Requests executed parallel

Destination

Hotels

Duration

Hotel Occupancy List

Lengths of stay

File size (MB)

Ouput file lines

Time (minutes)incremental: NO

Time(minutes)incremental: YES

PMI

562

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

182

1.118.740,00

6,23

8,59

LON

429

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

246

1.529.460,00

6,43

9,46

PAR

601

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

265

1.626.388,00

9,00

12,24

CUN

123

30

1+0, 2+0, 3+0, 4+0

1, 2, 3, 5, 6, 7

139

745.031,00

3,52

5,28

 

 

 

 

 

 

Total:

9,00

12,24

Implementing enumerated types

When you are implementing the process to read an enumerated type field you have to consider the possibility to get new values.

For example:
The field 22 in the Availability Output File corresponds to the enumerated type PACKAGING. The actual values could be: Y, N and B. Your process should be able to get another value Z without fail your complete process.


Docs Navigation