Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
Is it a best practice to do operations with data in the client-side or in the server-side?

For example, if I have to sort an array of data from a database to append it on the body of a web page. In terms of performance, should I sort it on the server-side and then send it to the client or should I send the data as it is and sort it on the client-side or it makes no difference?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

If you do it on the client, then every client has to sort the data no matter how fast the client computer is. It might be a developer's ultra-powerful laptop or it might be someone's 5-year old budget Android phone.

If you do it on the server, then the server has to sort the data for every client and you have to pay for the computing resources. However, you do get the opportunity to cache the sorted data which is a saving (if the data doesn't change too frequently).

There isn't a one-size-fits-all answer here.

about 4 years ago · Juan Pablo Isaza Denunciar

0

This is a common problem that beginner, intermediate, and expert developers may struggle with. It's really an architectural question that is best answered with as much context as possible.

What is your API running on? If you're hosting in the cloud (AWS, Azure, etc.), are you trying to minimize hosting costs by minimizing resource usage? If so, pushing that work onto clients may help at scale, but is probably negligible for small applications.

What about your clients? Are you only supporting desktop machines in an enterprise environment where there's a high probability that you can generalize their specifications? Or are IoT devices with minimal computing resources contacting your API? In the latter case the client device may not have the memory or computational power to sort the data while still meeting the rest of its duties. What about mobile devices that may be 10-20 years old?

Is this fixed behavior on your API or can clients request server-side sorting? What sort of flexibility do you want your API to provide and how feasible is it to implement switches and parameters for every facet? At what point are you doing too much, obscuring the purpose of the API with a plethora of buttons and dials to configure or tune.

In my personal experience, I like ORMs like Sequelize that can expose a lot of flexibility on your API with little work, but these tools can come at a computational cost and potential (but usually infrequent) security issues. They're very general implementations that aren't always perfect for your use case.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda