A
A
alex4answ2020-04-30 17:06:26
Node.js
alex4answ, 2020-04-30 17:06:26

Is it worth splitting 1 general request into several smaller ones?

RESTFul API (Node js)
Frontend on Rect+Redux.

now there is 1 general query like:
"Give me Car %name% and all its spare parts"

Should we break such queries into more precise and smaller ones?
1. Give me the car %name%
2. Give me the parts for the car %name%

I think it's worth it, because it will allow you to create more flexible compositions from the data, you will not need to create copies of the controllers for "clarifying", slightly modified queries.

But, because I'm not sure, and just started, I decided to ask if my statement is true ^ ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2020-04-30
@alex4answ

If you want beautiful, flexible - fractions.
If you want productive-fast - do not use fractions.

A
Andrey, 2020-04-30
@AndryG

And if you add a list of parts that are asked to be returned?
give me:
* car
* spare parts
* service centers
* recycling
* all departments
The user can choose which data to request in one request: one, two or all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question