Repository: management-node
Description: Provides APIs to be accessed by Consumer and Producer Federators for the purpose of dynamic configuration management
SPDX-License-Identifier: Apache-2.0 AND OGL-UK-3.0
This document describes the relational database schema used by the Management Node. The schema is applied via Flyway migrations located at:
src/main/resources/db/migration/
The database is designed to model Organisations, their Producers and Consumers, the Products offered by Producers, and the access grants that allow specific Consumers to access specific Products. Additional attributes can be attached to each grant.
- Organisation has many Producers and Consumers
- Organisation has one optional OrganisationCertificate
- OrganisationCertificate has many CertificateEvents
- Producer belongs to an Organisation
- Consumer belongs to an Organisation
- Product belongs to a Producer
- Product ↔ Consumer is a many-to-many relationship implemented via the join table
product_consumer - Each
product_consumer(grant) can have manyproduct_consumer_attributerows for extensible metadata
A simple ER diagram (Mermaid):
erDiagram
ORGANISATION ||--o{ PRODUCER : has
ORGANISATION ||--o{ CONSUMER : has
ORGANISATION ||--o| ORGANISATION_CERTIFICATE : has
ORGANISATION_CERTIFICATE ||--o{ CERTIFICATE_EVENTS : logs
PRODUCER ||--o{ PRODUCT : offers
PRODUCT ||--o{ PRODUCT_CONSUMER : grants
CONSUMER ||--o{ PRODUCT_CONSUMER : consumes
PRODUCT_CONSUMER ||--o{ PRODUCT_CONSUMER_ATTRIBUTE : has
PRODUCT_TYPE ||--o{ PRODUCT : categorizes
ORGANISATION {
BIGSERIAL id PK
VARCHAR name
BOOLEAN certificate_automation_enabled
}
PRODUCER {
BIGSERIAL id PK
VARCHAR name
TEXT description
BIGINT org_id FK
BOOLEAN active
VARCHAR host
NUMERIC port
BOOLEAN tls
VARCHAR idp_client_id
}
CONSUMER {
BIGSERIAL id PK
VARCHAR name
BIGINT org_id FK
VARCHAR idp_client_id
VARCHAR schedule_type
VARCHAR schedule_expression
}
PRODUCT_TYPE {
BIGSERIAL id PK
VARCHAR name
VARCHAR description
}
PRODUCT {
BIGSERIAL id PK
VARCHAR name
VARCHAR topic
BIGINT producer_id FK
BIGINT product_type_id FK
VARCHAR source
}
PRODUCT_CONSUMER {
BIGSERIAL id PK
BIGINT product_id FK
BIGINT consumer_id FK
TIMESTAMP granted_ts
NUMERIC validity
VARCHAR schedule_type
VARCHAR schedule_expression
VARCHAR destination
}
PRODUCT_CONSUMER_ATTRIBUTE {
BIGSERIAL id PK
VARCHAR name
VARCHAR type
VARCHAR value
BIGINT product_consumer_id FK
}
ORGANISATION_CERTIFICATE {
BIGSERIAL id PK
BIGINT organisation_id FK
VARCHAR subject_dn
VARCHAR serial_number
BOOLEAN is_renewable
BIGINT renewal_ttl
VARCHAR type
TIMESTAMP requested_at
TIMESTAMP issued_at
TIMESTAMP expires_at
TIMESTAMP revoked_at
}
CERTIFICATE_EVENTS {
BIGSERIAL id PK
BIGINT organisation_certificate_id FK
VARCHAR type
VARCHAR event_type
TIMESTAMP event_time
VARCHAR performed_by
}
Represents an organisation that owns Producers and Consumers.
Columns:
idBIGSERIAL, primary keynameVARCHAR(150), not nullcertificate_automation_enabledBOOLEAN, not null, default TRUE
Usage:
- Parent entity for
producer,consumer, andorganisation_certificate.
Represents a Producer federator/service that offers one or more Products.
Columns:
idBIGSERIAL, primary keynameVARCHAR(50), not nulldescriptionTEXT, not nullorg_idBIGINT, not null, foreign key →organisation(id)activeBOOLEAN, not nullhostVARCHAR(500), not null — host or base URL where the producer can be reachedportNUMERIC, not null — network port (stored as numeric)tlsBOOLEAN, not null — whether TLS is required for this endpointidp_client_idVARCHAR(50), not null — identity provider client id (e.g., Keycloak). Informational; not an FK
Usage:
- Owns
productrecords. - Links an Organisation to concrete connection details for the Producer.
Represents a Consumer federator/client that requests access to Products.
Columns:
idBIGSERIAL, primary keynameVARCHAR(50), not nullorg_idBIGINT, not null, foreign key →organisation(id)idp_client_idVARCHAR(50), not null — identity provider client id (e.g., Keycloak). Informational; not an FKschedule_typeVARCHAR(100), nullable — type of schedule, e.g.,cron,intervalschedule_expressionVARCHAR(255), nullable — schedule expression matching the chosen schedule_type
Usage:
- Participates in access grants via
product_consumer. - Optional scheduling metadata for consumer-driven jobs.
Represents a category/type of Product (e.g., topic-based, file-based).
Columns:
idBIGSERIAL, primary keynameVARCHAR(150), not nulldescriptionVARCHAR(255), nullable — brief description of the product type
Usage:
- Lookup table used to categorize products. Initial values seeded by migration:
topicandfile.
Represents a Product (e.g., a data stream or dataset) offered by a Producer.
Columns:
idBIGSERIAL, primary keynameVARCHAR(50), not nulltopicVARCHAR(150), not null — logical topic or channel for the productproducer_idBIGINT, not null, foreign key →producer(id)product_type_idBIGINT, nullable, foreign key →product_type(id)— categorization of the productsourceVARCHAR(500), nullable — optional source identifier/URI for the product
Usage:
- The resource being granted to Consumers via
product_consumer. - Migration defaults existing rows to the
topicproduct type.
Join table representing an access grant that allows a Consumer to access a Product.
Columns:
idBIGSERIAL, primary keyproduct_idBIGINT, not null, foreign key →product(id)consumer_idBIGINT, not null, foreign key →consumer(id)granted_tsTIMESTAMP, not null — timestamp when access was grantedvalidityNUMERIC, not null — validity period/units are application-definedschedule_typeVARCHAR(100), nullable — e.g.,cron,intervalschedule_expressionVARCHAR(255), nullable — expression matching the schedule_typedestinationVARCHAR(500), nullable — optional destination identifier/URI for scheduled deliveriesuq_product_consumer_pairUNIQUE (product_id,consumer_id) — ensures one grant per pair
Notes:
- Originally used a composite primary key (
product_id,consumer_id); later replaced by surrogateidwhile preserving uniqueness viauq_product_consumer_pair.
Usage:
- Central record for authorization decisions: which Consumer can access which Product and since when.
- Optional scheduling metadata for grant-level processing/delivery.
Extensible attributes attached to a specific product_consumer grant (key/value-like rows with a simple type field).
Columns:
idBIGSERIAL, primary keynameVARCHAR(150), not null — attribute name/keytypeVARCHAR(50), not null — attribute type (string indicator)valueVARCHAR(500), not null — attribute valueproduct_consumer_idBIGINT, not null, foreign key →product_consumer(id)
Usage:
- Store additional constraints or metadata for a grant (e.g., scopes, rate limits, contractual flags). Semantics are defined by application logic.
Tracks the current certificate state for each organisation. Each organisation has at most one certificate record.
Columns:
idBIGSERIAL, primary keyorganisation_idBIGINT, not null, unique, foreign key →organisation(id)subject_dnVARCHAR(500), nullable — X.500 distinguished name of the certificate subjectserial_numberVARCHAR(150), nullable — certificate serial numberis_renewableBOOLEAN, not null, default FALSE — whether automatic renewal is enabledrenewal_ttlBIGINT, nullable — renewal time-to-live valuetypeVARCHAR(50), not null — certificate type (e.g.,MANUAL,BOOTSTRAP,AUTOMATED)requested_atTIMESTAMP, nullable — when the certificate was requestedissued_atTIMESTAMP, nullable — when the certificate was issuedexpires_atTIMESTAMP, nullable — certificate expiry timerevoked_atTIMESTAMP, nullable — when the certificate was revoked (if applicable)
Constraints:
- UNIQUE on
organisation_id— one certificate record per organisation - Index on
organisation_id
Usage:
- Records the lifecycle state of each organisation's certificate. The
typefield tracks whether the certificate was manually provisioned, issued via the bootstrap flow, or issued via automated renewal.
Audit trail of certificate lifecycle events for each organisation certificate.
Columns:
idBIGSERIAL, primary keyorganisation_certificate_idBIGINT, not null, foreign key →organisation_certificate(id)typeVARCHAR(50), not null — certificate type at the time of the eventevent_typeVARCHAR(50), not null — the event that occurred (e.g.,ISSUED,RENEWED,EXPIRED,REVOKED)event_timeTIMESTAMP, not null — when the event occurredperformed_byVARCHAR(255), nullable — identifier of the actor who triggered the event
Constraints:
- Index on
organisation_certificate_id
Usage:
- Provides an audit log of all certificate lifecycle transitions. Each event captures what happened, when, and who performed the action.
- Schema is versioned and applied with Flyway on application startup.
- Foreign keys enforce referential integrity among core entities.
- Consider adding database indexes on foreign key columns (
producer.producer_id,consumer.org_id,product.producer_id,product_consumer.product_id,product_consumer.consumer_id,product_consumer_attribute.product_consumer_id) to optimize query performance.
- Identity fields like
idp_client_idare not foreign keys; they link to external IdP configuration (e.g., Keycloak) at the application layer. - Ensure that any PII or sensitive metadata stored in attributes follows your organization’s data handling policies.