I am programming an web app similar to the hotels or flying finder.
I have see for example http://www.momondo.com/ .
This website show you 1700 hotels and you can filter. You can choose 3 starts, rechoose 3 starts, delete 2 starts, Internet at the room, price range, … But the filter seem that dont use the network to make another query to the Database.
It filter the result in the browser of the client?
What do you think? A browser support the info of 1700 hotels load in memory?
Modern web browsers support what’s either known as ‘localstorage‘ or ‘Web Storage‘.
This basically allows you to load a bunch of data into the client machine, and use database operations locally. If your dataset size is reasonable (under a few MB), this can be efficient, as you don’t have the scaling issues of trying to do everything on the server.
If you’re dealing with huge datasets, you’ll push up against browser limits and have to get people to reconfigure their browser, but you’re likely not going to be having them display 500MB of data at once, so it might be more efficient from a network standpoint to partition the data into smaller chunks anyway.
As for the ‘best’ solution … it likely depends on how much data they’re going to need relative to the entire dataset. I’m dealing with some databases that are tens of millions of records, so I do the filtering server side, but if they want to do additional filtering after the initial search, it’s better for me to do it client side, just to offload the processing and reduce the network traffic.