Alex Rivera | Logout

Search Filter, should I do it client side or server side?

Asked 2011-12-03T13:36:12.893
16

I have a search form that returns a list of results, I also have a filter area where the user can filter down the results (price etc). My question is, should I be doing the filtering through client side javascript or should I do it serverside within the MYSQL select?

The issue is, the filtering will have quite a few levels, so when putting this into a mysql select could become quite tedious.

Edit
Report

2 Answers

3

You should realize the consequences if you put it in client side.

  1. You may have to pass far more data through the Internet than you want.

  2. You may not be able to use some good stuff of MySQL like index or cache to optimize your results. These well designed and tested functions are always better than yours.

However, I think it's perfectly OK to do this on the client side if you are cool with these consequences.

answered 2011-12-03T13:50:28.820
0

It should be server side in your SQL.

Something like SELECT * WHERE price > 100

If you do it in the client side, you need to send to much data from server to client.

answered 2011-12-03T13:44:11.340

Your Answer