Concepts / Web Services and REST Architecture

Web Services and REST Architecture

Service-oriented architecture enables travel websites to integrate multiple independent systems (airlines, hotels, car rentals) through web service calls, allowing a single interface to coordinate bookings across different organizations.

  • Programming

One Search, Many Systems

When you search for a vacation, one travel website may display flights, hotel rooms, and rental cars in one interface. However, these results do not necessarily come from one shared database. The airline, hotel company, and car rental company each maintain its own computers, data, and systems. The travel website acts as an orchestrator: it sends web service calls to those independent systems and combines their responses into one user experience.

one requestflight queryroom queryvehicle queryflight resultsroom resultsvehicle resultsTravelersearch and booking requestTravel websiteorchestratorAirline serviceflight dataHotel serviceroom dataCar rental servicevehicle data
How does the travel website coordinate separate airline, hotel, and car rental systems while presenting one booking interface?

Following the Search

A Vacation Search

Trace what happens after a traveler enters search criteria for flights, hotels, and rental cars.

1. Enter criteria: The traveler enters search criteria into the travel website interface.

2. Send service calls: The travel website sends a query to the airline service, a query to the hotel service, and a query to the car rental service.

3. Query local databases: Each service queries the database owned by its organization: the airline database, hotel database, or car rental database.

4. Return results: The independent services return their results to the travel website.

5. Display one view: The travel website aggregates the results and displays them through its single interface.

The traveler experiences one search, but the system has performed multiple independent queries against different organizations' systems.

1. search2. query3. query4. query5. flight response6. room response7. vehicle responseTravelersearch criteriaTravel websiteorchestratorAirline serviceflight queryHotel serviceroom queryCar rental servicevehicle querySearch resultsaggregated response
What happens next as a search moves from the traveler through the travel website to independent partner services?

This is service-oriented architecture in practice. The travel website provides coordination, not ownership of every underlying dataset. Its interface makes the systems feel unified to the traveler, while the organizations remain independent behind that interface.

Authoritative Data Ownership

In this architecture, each organization maintains a single authoritative copy of its data in its own database. The travel website does not create a separate copy of the airline's flight inventory, the hotel's room inventory, or the car rental company's vehicle inventory. Instead, it queries the owning service through web service calls.

ownsownsownsqueries through airline servicequeries through hotel servicequeries through car serviceAirlineflight databaseFlight dataauthoritative copyTravel websitequeries servicesHotel companyroom databaseRoom dataauthoritative copyCar rental companyvehicle databaseVehicle dataauthoritative copy
Which service owns each piece of reservation data, and how does the travel website access the authoritative copy?
ArchitectureData arrangementControl
Service-oriented architectureEach organization keeps its own authoritative dataEach data owner controls its service and rules
Monolithic architectureOne application owns a combined database for flights, hotels, cars, payments, and user accountsThe single application controls the combined data

Boundaries and Permissions

Data ownership is reinforced through defined web service interfaces. A partner does not receive unrestricted access to another organization's entire database. The data owner decides which information can be queried, which actions can be performed, who may access the service, and under what conditions.

service requestpermits querypermits booking actiondoes not exposedoes not exposeTravel websitepartner clientHotel web servicedefined capabilitiesAvailable roomsallowed queryRoom reservationallowed actionGuest paymentinformationnot exposedPast booking historynot exposed
How are permissions enforced when the travel website requests or updates hotel-owned data?

The source describes a hotel service that permits the travel website to query available rooms and make reservations, while not permitting access to guest payment information or past booking history. The hotel therefore remains autonomous even while participating in the travel website's booking experience.

From Booking to Payment

A complete booking is not one update to one shared database. It is a sequence of web service calls involving multiple systems. The travel website coordinates the interaction, while each participating system updates its own database independently.

1. initiate booking2. reservation request3. reservation request4. reservation request5. airline result6. hotel result7. car result8. payment request9. payment resultTravelerbooking initiationTravel websitecoordinatorAirline servicereservation requestHotel servicereservation requestCar rental servicereservation requestPayment systempayment processingReservationconfirmationbooking outcome
What happens next as a user's booking request moves through partner services to reservation confirmation and payment processing?

Tracing a Complete Booking

Explain the systems involved when a traveler books a flight, hotel, and car through one travel website.

Booking begins: The traveler submits a booking request through the travel website.

Reservations are requested: The website sends reservation requests to the airline, hotel, and car rental services.

Local systems update: Each organization updates its own database independently rather than relying on a shared travel-site database.

Payment is processed: The booking flow includes payment processing through a third system.

The result is presented: The travel website coordinates the responses and presents the reservation outcome through its unified interface.

The traveler sees one coordinated transaction, but the underlying work crosses several independent services and databases.

Common Misunderstandings

  • Assuming the travel website owns all flight, hotel, and vehicle data.

    The airline, hotel, and car rental organizations maintain their own systems and databases.

    Fix: Think of the travel website as an orchestrator that queries independent services.

  • Assuming the travel website permanently copies partner inventory.

    A copied inventory can become stale and can contribute to overbooking.

    Fix: The travel website queries the owning service's authoritative data in real time.

  • Assuming a service partner can inspect an organization's entire database.

    Data owners control access through defined interfaces and can restrict both data and actions.

    Fix: Separate permitted capabilities, such as room queries and reservations, from restricted information.

  • Treating a complete booking as one database transaction owned by the travel website.

    A booking involves multiple sequential web service calls, and each system updates its own database independently.

    Fix: Trace the booking as coordinated requests across independent services.

Check Your Model

MEDIUM

A hotel changes its available-room data after the travel website has already displayed search results. Explain which system should be treated as authoritative, why the travel website should query the hotel service rather than rely on its own copy, and how the hotel's service interface can restrict what the travel website is allowed to do.

Hints
  • Identify the organization that owns the room data.
  • Connect real-time querying with consistency and prevention of overbooking.
  • Distinguish allowed room queries and reservations from restricted hotel information.
MEDIUM

Reconstruct the booking sequence in order: payment processing, search queries, reservation requests, and the travel website presenting the coordinated result. Then explain why each participating system updates its own database.

Hints
  • Begin with the user's search and the travel website's queries.
  • Reservation requests follow the search stage.
  • Payment processing is handled through a third system.
  • Data ownership remains with each organization.

Key Takeaways

  1. A travel website can provide one interface while coordinating independent airline, hotel, and car rental services through web service calls.
  2. Each organization keeps a single authoritative copy of its own data, and the travel website queries that data instead of creating competing inventory copies.
  3. Data owners preserve autonomy and security by defining what partner services can query and which actions they can perform.
  4. A complete booking crosses multiple sequential service calls, including searches, reservation requests, independent database updates, and payment processing through a third system.

Key Takeaways

  • Service-oriented architecture lets one travel website coordinate many independent organizations.
  • The organization that owns data maintains the authoritative copy in its own database.
  • Real-time service calls reduce the risk of stale inventory and overbooking.
  • Defined web service interfaces let data owners control access, permitted actions, and restrictions.
  • A booking is a coordinated sequence of searches, reservation requests, independent updates, and payment processing.