Devices Query Limitation

Hi,

Some time ago I opened this topic [¹] to check about this limitation, but our application has grown and we started to check some problems related to this limitation in the devices query. We have a multi-tenant application, which has some access hierarchy levels (client, site, plant). And a user can have access to several clients, plants (and if he has access to a client, he automatically has access to the associated plants).

However, what is happening is that we cannot easily limit the number of groups for a user. Because after a user receives access to clients, plants associated with these clients can be registered. So, even if we limited the number of plants for a customer, it is possible that the registration of new plants associated with existing customers, exceeds the limit of 100 groups for a specific user, while for the user who is registering the plant it does not go beyond the limit of 100 groups. limit.

I would like to check more details about how the devices query based on experienceUserId works. I believe that to solve this query, the experienceUserId is transformed into a list of experienceGroupIds (both the groups that are directly associated with the user, as well as the subgroups of these groups). And if this is the working behind the resolution of this query, would you have any suggestions about this architectural challenge (if you have the knowledge of another application that has gone through this scenario).

Any questions I can send more details about the application.

Hey @Vander_Maziero,

Yes, this limitation still applies and has impacted a number of customers. The underlying issue is related to how the group hierarchy unrolls into an actual database query. When a request is made, the system begins traversing the group hierarchy and appending the individual device queries for all child groups together into one big query to pass to the database.

Databases aren’t able to execute arbitrarily large queries, so we have a protection limit at 100 query components.

The most common workaround is to ensure a user, through the group hierarchy, doesn’t belong to more than 100 total groups.

We have been designing a new approach to device groups with the intention of solving this specific technical limitation. I don’t have a timeline for when it’d be available.

1 Like