I have a JS application, which communicates with the server only by API calls. All the data for the app is recieved via API calls. Is it better to sort table-like data on client side (js), or server side (PHP/MySQL) ? Is it possible to sort reliably with js ? I’m keen to sort on client side, but not sure if this reliable enough.
Share
You can sort on client side. But it is not efficient if you have a lot of data. In this case you need to provide some pagination mechanism and it makes no sense to sort paginated results clientside.
The answer from me: use server side sorting if you have A LOT of data (hundreds of records may be an indication, but look what works for you). Otherwise load all the data using api call and sort client side.