Concepts / Data Consistency Across Distributed Systems

Data Consistency Across Distributed Systems

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 Booking, Many Systems

When someone books a vacation through one travel website, the experience appears unified: flights, hotels, and car rentals can be searched and booked in one place. The underlying systems, however, remain separate. The airline owns its flight data, the hotel owns its room data, and the car rental company owns its vehicle data. The travel website coordinates these independent systems through web service calls rather than storing everything in one central database.

The central idea is one interface for the traveler, but many authoritative data sources behind that interface.

Search Request Routing

Service-oriented architecture, or SOA, lets the travel website act as an orchestrator. The user submits search criteria to the travel website. The website then sends separate requests to the airline service, hotel service, and car rental service. Each service queries its own organization's database. The results return to the travel website, which aggregates them and presents them through its single interface.

submits searchqueriesqueriesqueriesreturns availabilityreturns availabilityreturns availabilityTravelerSearch criteriaTravel websiteOrchestratorAirline serviceAirline databaseSearch resultsAggregated displayHotel serviceHotel databaseCar rental serviceCar rental database
How does the travel website route one search to separate airline, hotel, and car rental systems and bring their results back together?

The important distinction is that this is not one database query. It is a coordinated set of independent queries. The travel website knows how to communicate with each service, but each organization continues to operate and maintain its own system.

Authoritative Reservation Data

Each organization maintains a single authoritative copy of its data in its own database. The travel website does not copy the hotel's room inventory, the airline's flight data, or the car rental company's vehicle data. Instead, it queries the relevant service in real time. This arrangement helps the website avoid relying on a stale copy that no longer reflects the owning organization's records.

queries through servicequeries through servicequeries through serviceis authoritative foris authoritative foris authoritative forAirline dataAirline databaseTravel websiteReal-time service accessAirline authorityAuthoritative flightrecordsHotel dataHotel databaseHotel authorityAuthoritative room recordsCar rental dataCar rental databaseCar rental authorityAuthoritative vehiclerecords
Where is each reservation record authoritative, and how do other services access it without creating conflicting copies?

Ownership and Access Rules

SOA does not mean that every service can freely inspect or change every database. The organization that owns the data controls access through defined web service interfaces. A hotel can expose operations for querying available rooms and making reservations while withholding guest payment information or past booking history. The interface therefore expresses both what another service may access and what actions it may perform.

This preserves organizational autonomy. The airline controls its flight data and its rules, the hotel controls its room data and its rules, and the car rental company controls its vehicle data and its rules. The travel website coordinates these services, but it is not the owner of their underlying data.

Data or operationAuthoritative ownerTravel website's role
Flight availabilityAirlineQuery through the airline service
Hotel room availabilityHotelQuery through the hotel service
Car rental availabilityCar rental companyQuery through the car rental service
Hotel reservationHotelRequest a reservation through the hotel service
Guest payment informationHotel system or its designated ownerAccess only if the defined service interface permits it

Ownership determines which organization controls the data and which actions can be exposed through a service.

Booking Transaction Trace

A complete booking is a sequence of web service calls rather than one update to one database. First, the travel website sends search queries to the relevant services. After the user chooses travel options, the website sends reservation requests to the airline, hotel, and car rental services as needed. Each service updates its own database independently. Payment is then processed through a third system.

1. submits booking2. reservation request3. reservation response4. reservation request5. reservation response6. reservation request7. reservation response8. payment processing9. payment result and confirmation flowTravelerInitiates bookingTravel websiteCoordinates callsAirline serviceUpdates airline databaseHotel serviceUpdates hotel databaseCar rental serviceUpdates car rental databasePayment serviceProcesses paymentReservationconfirmationReturned to traveler
What happens next as a user submits a travel booking, each service confirms its reservation, and payment is processed?

Tracing a Multi-Service Booking

A traveler uses one website to arrange a flight, hotel room, and rental car. What does the website coordinate, and where are the records updated?

Search: The travel website sends separate search queries to the airline, hotel, and car rental services. Each service consults its own database.

Reservation requests: After the traveler selects options, the travel website sends reservation requests to the appropriate services.

Independent updates: The airline, hotel, and car rental systems update their own databases rather than a shared database owned by the travel website.

Payment: Payment processing occurs through a third system as part of the complete transaction.

Confirmation: The travel website coordinates the responses and presents the booking experience through its unified interface.

The website coordinates the transaction, while each participating organization remains responsible for its own data and system updates.

Mistakes About Distributed Data

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

    Each organization maintains its own database and controls its own data.

    Fix: Think of the travel website as an orchestrator that calls services owned by independent organizations.

  • Assuming the website copies inventory and keeps it synchronized later.

    A copied record may not reflect the hotel's current data and could contribute to overbooking.

    Fix: The website queries the owning service in real time instead of maintaining its own copy of that data.

  • Assuming service integration gives unrestricted database access.

    Data owners expose defined interfaces with specific capabilities and restrictions.

    Fix: Separate the ability to use an allowed service operation from direct access to the entire database.

  • Treating a complete booking as one update in one transaction.

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

    Fix: Trace the separate search, reservation, and payment interactions across the participating services.

Apply the Coordination Model

MEDIUM

A travel website receives a request to find a flight and hotel. Explain which systems the website contacts, where each system gets its data, and why the website should not rely on a copied inventory database.

Hints
  • Identify the independent airline and hotel services.
  • Remember that each organization queries its own database.
  • Connect real-time access to avoiding inconsistent availability.
MEDIUM

Now trace a booking that includes a flight, hotel, and rental car. List the sequence of service interactions from the user's booking request through the reservation responses and payment processing. For each reservation, identify which organization updates its own database.

Hints
  • Start with the travel website receiving the user's request.
  • Place the airline, hotel, and car rental reservation requests as separate service calls.
  • Place payment processing through a third system in the complete transaction.

What to Remember

  1. SOA gives the traveler one interface while connecting that interface to independent airline, hotel, and car rental systems.
  2. Each organization keeps a single authoritative copy of its own data and exposes access through web services.
  3. Real-time queries to the owning service help the travel website avoid relying on stale copied inventory.
  4. Data owners decide which information and operations other services can access.
  5. A complete booking is a sequence of service calls involving searches, reservation requests, independent database updates, and payment processing.

Key Takeaways

  • A travel website can provide one booking experience by orchestrating web service calls to independent organizations.
  • The airline, hotel, and car rental companies each maintain the authoritative copy of their own data.
  • The owning organization controls access through defined service interfaces and preserves its autonomy.
  • Searches, reservations, and payment are separate stages in a multi-service transaction.
  • Consistency is supported by querying current data from its owner instead of maintaining conflicting copies.