Metadata & Versioning
Automated database schema tracking and semantic versioning.
Overview
The Arya Banking platform features a custom Metadata Versioning System that automatically tracks changes to MongoDB document structures without manual intervention.
How It Works
- Annotation: Developers mark domain models with
@TrackMetadata. - Scanning: The
MetadataInitializerscans the classpath for these annotations. - Hashing: A deterministic hash is generated based on the class's fields, types, and validation rules.
- Comparison: The hash is compared against the latest stored metadata in MongoDB.
- Versioning: If the hash differs, the system calculates a new Semantic Version and persists the update.
Semantic Versioning Logic
The system automatically classifies changes to determine the version bump:
| Change Type | Version Bump | Trigger |
|---|---|---|
| MAJOR | X.0.0 | A field was removed or a data type changed. |
| MINOR | x.Y.0 | A new field was added. |
| PATCH | x.y.Z | Nullability or validation rules changed. |
Metadata Loader (Separate Repo)
The metadata loader is a standalone Spring Boot application hosted in its own repository:
Repository: arya-banking-common-metadata-loader
Group ID: org.arya.banking.common.loader
Artifact ID: arya-banking-common-metadata-loader
It depends on the core module and runs as an independent process — it is not part of the arya-banking-common reactor build.
Running Locally
cd arya-banking-common-metadata-loader
mvn spring-boot:run
Requires a running Vault and MongoDB instance.
CI/CD
The loader has its own deployment pipeline and runs after the common library modules are published, ensuring the metadata database stays in sync with the codebase.
Tracked Models
Currently, the following entities are under active metadata tracking:
UserRoleSecurityDetailsRegistrationProgressAuditUserCredentials