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

前端 未结 4 591
刺人心
刺人心 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:20

    It depends... :)

    1. How much data is to be sorted? How fast? "fast as possible" ok... what's the slowest you can accept? Can the client handle this? What about the server? What other responsibilities do these elements have and does this create conflict?
    2. How reliably must the data be sorted? For example, if the data were not sorted sometimes would this be OK?
    3. How are the responsibilities allocated to the elements in your architecture? For that matter, what are the elements? Do you have a database? What about a business tier? The world could be more complex than just "client vs. server"
    4. How will the data be used? Will multiple sorts need to be performed? For example, A->Z and Z->A?
    5. Is the cost of transferring data between the client and server reasonable? Are there other ways to make it reasonable?

    Architecturally speaking, to answer this question you need to decide on the desired properties in your system and evaluate the trade-offs among various design alternatives. Without knowing more about your system it is difficult to offer advice beyond this.

提交回复
热议问题