Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBC Device Registry - DeviceRegistrations Table: Add mapping table for gateways to allow search & filter mechanisms #3568

Open
julian-sotec opened this issue Oct 11, 2023 · 2 comments

Comments

@julian-sotec
Copy link

julian-sotec commented Oct 11, 2023

Background Information: Hono supports gateways that are very useful in scenarios where the device itself cannot communicate through honos standard adapters.
However: As the device registrations SQL table schema using JSON operators might be sufficient for basic use cases and SQL queries - more advanced queries and filters to device properties stored in its data field are very complex and therefore also inefficient.
Example: Finding out a device is a gateway currently involves going into the data field of a device and checking a json structure for the "via" attribute.

That being said our suggestion would be introducing a mapping table containing the information if a device is a gateway - allowing easier queries and access to the gateway information. The mapping table schema will look like this:

ID TenantID GatewayID DeviceID
1 1 1 2
2 1 1 3

In addition this kind of schema improvements will be also applied to the viaGroups and memberOf attributes.

Since this change will also involve migration work for existing users of the gateway feature in jdbc use cases we also plan to provide a migration script that would typically run either automatically or manual.

@harism
Copy link
Contributor

harism commented Oct 17, 2023

Bear in mind that via attribute for devices is not the only way to use certain devices as gateway devices. There is also gateway groups marked with device attributes memberOf and viaGroup which makes certain devices act similarly as gateway devices. If there is plans to create separate table for via information maybe the two other gateway group attributes could be addressed the same time with a bit more flexible table(s) structure and not make a solution for this one attribute only?

@julian-sotec
Copy link
Author

Bear in mind that via attribute for devices is not the only way to use certain devices as gateway devices. There is also gateway groups marked with device attributes memberOf and viaGroup which makes certain devices act similarly as gateway devices. If there is plans to create separate table for via information maybe the two other gateway group attributes could be addressed the same time with a bit more flexible table(s) structure and not make a solution for this one attribute only?

Thank you for your Input on this. I briefly mentioned what you described in the Issue above. We will defenetly take this into consideration. If you have any suggestion on a table schema on viaGroup / memberOf - feel free to share it with us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants