I could create
N number of routes by the following data
name attribute is unique where as in
routes there is no such thing. Is that a feature? If so, where should I use this feature?
Is that a feature?
No, it is not a feature. You can’t use the absence of a unique field in
routes in any way.
If it’s not a feature, it will leads to Data Duplication, right? Will that be a problem?
The purpose of unique names in Services is not preventing data duplication. It’s making services easier to use when dealing with them in the Admin API - human-given names are more ergonomic than UUIDs.
Nothing prevents you from creating two services with different names but the same protocol, host, port & path.
Will that be a problem
Data duplication can be a problem in certain cases, yes. It means you will have to be careful in some occasions.
But at the same time it can be useful. For example, you might want might want to arrange your routes into two big “groups” with different plugins, permissions, etc. Even if they all consume data from the same upstream API. By allowing two Services pointing to the same place, you can achieve this quite easily.
There are no check for data duplication on the Routes attributes due to implementation constraints. There are some “unsolvable” issues like dealing with regex paths or wildcard hosts, but no data duplication detection is done on other simple cases (such as your example) due to time constraints on our side, the lack of real need for the check (we don’t believe it is a major flaw), some users might even rely on it as a way to temporarily “swallow” traffic to a Service onto another one, etc…