Should data sorting be done on the client or on the server?

前端 未结 4 578
刺人心
刺人心 2021-02-05 09:39

I get data from a server and want to display it using GWT on the client.

GWT is not the problem here, you can replace GWT by Ajax calls or you can transpose it to a real

4条回答
  •  粉色の甜心
    2021-02-05 10:28

    Each approach has its pros and cons:

    • If you need pagination, and don't want to download the entire data to the client, then you must perform the sorting on the server (otherwise the client can only sort the rows it currently has, which will lead to wrong results, if you re-sort by a different column)
    • Sorting on the server is faster (as in: you can sort more rows/second), but if you have to serve 10000 clients at once, this may easily invert.
    • When sorting on the client, you can re-sort without downloading the data again.

提交回复
热议问题