Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

66
Vistas
What is the best approach for API calling for the Records with large attributes?

Hi, let me explain the scenario first.

Say, I have a DB with -

a) 10,000 Records

b) 20 Records/page (pagination)

c) 100 attributes for each Record

Now I need to call an API for getting the Records as pagination. On button click, I also need to see details of any product. Now what is the best approach of the two below?

Approach 1: Call an API for getting the Records as pagination. While calling the API, send all 100 attributes for each Record. Now on button click, show the details of any Record (No new API will be called for details view)

Approach 2: Call an API for getting the Records as pagination. While calling the API, send only the required attributes (maybe 4/5 attributes) for each Record. Now on button click, call a new API and show the details of any Record (with 100 attributes)

Please let me know the best approach of the two. Any other better solution is also appreciable. Thanks in advance.

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think the approach 2 is better because it's good for the UX because user can get the required attributes to work on, So they don't have to wait the unnecessary attributes to do their job. and the same reason for network traffic.

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos