Connhex Resources is a service that manages resource registries.
What's a resource?
A resource is a representation of a (usually real-world) entity. Let's get started with a few examples and definitions:
- a device is a resource that represents a physical device (e.g. a pump, a valve, a sensor, a motor, etc.). A device can have many attributes (e.g. a serial number, a model, a manufacturer, etc.)
- a home is a resource that represents a physical home (e.g. a house, an apartment, a villa, etc.). A home can have many devices, so we say there's a relationship between a home and its devices.
Attributes and relationships
We have mentioned attributes and relationships. Broadly speaking:
- Attributes are the properties of the resource. They are the data that describes the resource.
- Relationships are links between resources. They are the links that connect the resource to other resources.
Why are they useful? Besides accurately reflecting reality in your data model, you can:
- use attributes to create complete device registries
- use relationships to manage historicization
The first use case for Connhex Resources is to manage device registries. This complements Connhex Data, which is responsible for handling the IoT-related data. A typical split between the two is:
|Connhex Resources||Serial number, model, type, lot, SKU,...|
|Connhex Data||Connection parameters, metadata,...|
Connhex Resources features resource historicization. Think of it as versioning for resources: you can see overtime how links between resources change. This is a bigger deal than it sounds. It usually falls under the "I wish I thought of that earlier" bucket, when you find yourself facing a massive migration. There are multiple cases where this is useful. For example:
- if the device changes ownership, you need to guarantee that the previous data won't be seen by the new owner
- if a resource is composed by multiple children resources that are the actual data publishers (e.g. a device has a BOM containing two motors), and one of the children (e.g. motor) is replaced due to a failure, you need to merge the data from the old and the new resource - while making sure that you can still distinguish between the two
Connhex Resources gives you this out of the box.
The vision for Connhex Resources is to provide a standard way to manage resource registries. We want to make it easy to create and manage resource registries, and we want to make it easy to integrate with other services.
- its APIs follow the JSON:API specification. More on that here
- it uses JSON Schema to define resource types. More on that here
There are many client libraries available for JSON:API. There are also many form builders for JSON Schema.
Combining these two, once you have defined the JSON Schema for the resource type, you can automatically perform CRUD operations on resources of that type.