• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

caching flights for performance

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen some posted thread suggesting to caching data when searching flight. My doubt is that flight is available only if seats are available. If flights are pulled out from the cache, seats may no longer available. In this case cache won't help much or am I missing something?
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vu,

caching flights info including its status(cancel or delay) and seats is good for search. I just wonder is there anyway to update the "in memory" version(actually only need one for each EJB container) if anything changed at DB side?
 
vu lee
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Joseph,
Since seats and flight status can change from one second to another, they are not good candidates to be cached. What do you think? I wonder how people cache flights.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Orbitz (a major website) do cache their flight search results. Last time I purchased a ticket, they kept on showing me the same flights. However, when you clicked on some of them, they will tell you (in a next screen) that they were no seats available.

I guess it is a matter of how you balance your customer satisfaction. Orbitz has too many queries (most of the people just try to look for cheap tickets). So, they will cache the results to maintain the bulk of their audience happy. However, if you want to give real online experience, I would not recommend doing so.

Geoffrey


Originally posted by vu lee:
Joseph,
Since seats and flight status can change from one second to another, they are not good candidates to be cached. What do you think? I wonder how people cache flights.

 
vu lee
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see... but in this case, an itinerary may contain many segments. If no seat available on one of these segments when user attempt to select a seat, the whole itinerary may become useless. By the way, are we focus too much on detail implementation or we are on the right track -- abstraction, high level view.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vu,

Caching has advantages and disadvantages. As usuall you have to decide what is more important for your case:

  • performance
  • valid data


  • Lucy
     
    Greenhorn
    Posts: 25
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Vu,

    this one coudl do your head in

    either solution seems valid. just make a choice and stick with it. if you look at different airline companies they provide flights and search fcilities in different ways and with different levels of success. So there is no correct functional answer. Just state how you are doign it and make sure your logic is sound. It doesn't have to be the perfect functional solution, just the perfect technical solution!
     
    vu lee
    Ranch Hand
    Posts: 208
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    is there a mutual exclusive between performance and valid when caching data? I would like to have both although it does sound impossible.

    Since the requirement emphasizes on the performance, I wonder whether I can make an assumption that user may get out_of_date data or invalid segments (seat is no longer available in one of these segment). Hm... It doesn't sound right because a user may end up building many invalid itineraries.
     
    Joseph Zhou
    Ranch Hand
    Posts: 129
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Vu,

    I think we need some strategy, here is just an example:

    The entire fight catalog is not cached. The user searches it when prepare an Itinerary, the search result can be cached, with flights, segments, ... and available seats(at least one). before check out, we can re-check the selected flights/seats availability - if a flight is not there, we have no choice, if a booked seat is not there, we can suggest a similar one(if the last one booked, we have no choice too) - and start a transaction for the booking.

    The preformance will not be too bad, and the chance to ask users to restart a itinerary should be rare.
     
    vu lee
    Ranch Hand
    Posts: 208
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Joseph,
    You propose to cache flights for a single user instead of all users. The system can discard the cache when a SFSB has timed out. I think it is a viable solution. What is your opinion on using CMR to model equipment and seats?
     
    Joseph Zhou
    Ranch Hand
    Posts: 129
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Vu,

    CMR is a good stuff in J2EE, I will use it. I think customer will happy with seating maps for selected flights.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic