Submit Your Article Forum Rules

Results 1 to 6 of 6

Thread: database and Ajax

Hybrid View

  1. #1

    Post database and Ajax

    I have a website (www.sky-tours.com) selling airline tickets worldwide. When clients search for a flight they enter the departure citiy and their destination.
    They either can enter a 3-lettercode if they know the airport, but also the town. After the 4th letter they enter the Ajax offers of similare cities starts.
    With slower connections this ajax responses are slow and often too slow that the client enters the full name of the town but its not searched in the database and client gets the answer no flights.

    I looked in travelocity.com and priceline.com and it looks like they don't use Ajax. I have been told Ajax is the best way. But I have my doubts now as I am gettig complaints from clients. and why those giant don't use ajax?

    Any suggestion what is the best way to do. (We have about 2400 cities stored in that database

  2. #2
    Member
    Join Date
    Feb 2005
    Location
    Colorado Springs, CO, USA
    Posts
    71
    I think Ajax is the best choice. Google's suggested search terms that are displayed as you enter a partial search text string are Ajax driven and respond very quickly. I think the coding methodology may be the issue in your case.

    When the Google search page loads, Google sets up the environment in advance, like creating the XMLHTTPRequest object, creating an empty div in the page for displaying suggestions. Here the X and Y coordinates and width of the search box are calculated and using these, div’s top, left, width style coordinates are set so that suggestions layer displays appropriately in alignment with search box.

    I'm far from an expert on this but try this Google search for coding tips: http://www.google.com/search?source=...AAAKoEBU_QTodO.

    Good luck!
    Pat Riley

  3. #3
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    760
    Surely the amount of data you are transferring back in the AJAX result is tiny. Therefore, the issue is not likely to be the client's internet connection speed but is much more likely an issue with your server/database speed.
    Dynamic Software Development
    www.activeminds.ca

  4. #4
    WebProWorld MVP chandrika's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    742
    I don't know if this will be any use to you but I had it in my bookmarks for a website I was considering building along the same lines and they use html and xml in order to keep the databases uptodate.
    http://www.wctravel.com/

  5. #5
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Actually Ajax is used to reduce the Load of the server. I think some database problem is there. Try to see the Query whatever you already use. To fetch the data from database that hold 2400 data is not so easy. Try to write the best query. Writing Query is so easy but we should also know the performance and execution time of the Query.

  6. #6
    Junior Member
    Join Date
    Sep 2010
    Posts
    18
    Make the Ajax call manually through the browser. See a) how long it takes the Db to return the query and then b) how much data is being returned.

    If a is taking too long, it should be easily optimized with some indexes by someone who knows databases.

    If b is too big then change the query to just return the data you need.

    If neither, then there's something wrong elsewhere.

    Based on the fact that you mention the problem happens with "slow connections" it sounds like b.
    Win.ly: A scientific/statistical approach to win prizes online.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •