A
A
anamorph2018-07-25 12:52:54
Web development
anamorph, 2018-07-25 12:52:54

Does this backend architecture affect the speed of the application?

I came across a project where the backender for storing data does not use id. In general
, that is, usually the data from the server looks like this:

[ {id: 1, name: 'Vasya', age: 30, married: true}, etc...]

and it uses a similar structure:
{ Vasya:  { age: 30, married: true }, Petya: {}, .....etc }

Do you think this is normal? What are the pros or cons? Could this slow it down?
There are problems on the front-end because of this, but in principle it is possible to adjust, but is it necessary?
Ps in theory, names are like keys, they will never be repeated

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim Timofeev, 2018-07-25
@anamorph

1. Who said that a unique identifier should be called exactly id (convenient of course, but not necessary). I am personally a supporter of having exactly id and always with auto-increment, but this is great for mysql. What you have there - we and apparently you do not know.
2. Who told you that id is not used? The fact that it doesn't get into the json you get doesn't mean anything.
These questions cannot be answered given the "abundance" of information. It is necessary to understand how it is real and in what data is stored.

A
Alexander Aksentiev, 2018-07-25
@Sanasol

How do you know it doesn't have an ID?
You never know in what format it issues data through api, inside it can be completely different.
What to slow down? Frontend? Backend? What is slow down in general in your understanding.
If there is so little data that the names are not repeated, then what kind of brakes and problems can we even talk about? All brakes directly depend on the curvature of the hands, and not on the fact that the data in the format is not volume.

I
Ivan, 2018-07-25
@IvanTheCrazy

Well, if the data from the server looks like this, this does not mean that there is no ID there. But why they look like that is another question. It should probably be set directly to the backender

A
Andrey K, 2018-07-25
@kuftachev

The front will not be slowed down by the lack of an ID ... But another question. It's a typo?
{ Vasya: { age: 30, married: true }, Petya: {}, .....
Or why is an array passed as an object?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question