Check Database Consistency Web Service

From FMR Knowledge Base
Revision as of 07:35, 4 April 2025 by Plazarou (talk | contribs) (Overview)
Jump to navigation Jump to search

Overview

The Fusion Metadata Registry (version 11), stores maintainable structures in a number of forms within its database. It is extremely unlikely that these formats become inconsistent, but a mechanism exists to check that the various formats are consistent. This mechanism is a simple Web Service that can be invoked by any user with administration privileges.

Detail

The Fusion Metadata Registry stores structure metadata in the following tables:

  • registry_maintainable_ser: this table stores the Java serialised form of each individual metadata structure. There serialised objects are loaded on application startup, since it is faster than constructing a new Java object from the XML.
  • registry_maintainable_sdmx: this table stores the SDMX-ML form of the individual metadata structure. This table is a backup for the "serialised" table. If an structure cannot be deserialsed, then the structure is obtained from this table.
  • tx_backup: this table stores the SDMX-ML form of structures, grouped together by the transaction they were submitted within rather than storing each structure individually.

When a new structure is submitted, or an existing structure is modified, each of the above 3 tables will be updated.

Check Database Consistency Web Service

Entry Point /ws/secure/structure/databaseconsistency
Access Secure
Http Method GET
Response Format JSON
Response Statuses

200 - Success

400 - Unauthorized

Note: Because the service has to talk to the back-end database, it may take a while to run. The time taken depends upon the speed of connection to the database and the number of structural metadata within your Registry.

Example Output

The Web Service produces JSON output like the following:

{
  "Consistency": false,
  "MaintainablesChecked": 2053,
  "DifferingSdmx": [
    "[]"
  ],
  "DifferingTxn": [
    "[urn:sdmx:org.sdmx.infomodel.codelist.Codelist=SDMX:AAA(1.0)]"
  ]
}

Examples

An example of the consistency checker being invoked:

https://example.registry.com/ws/secure/structure/databaseconsistency