How grookage/leia works
Main Components
• Client-side Components:
• leia-client and leia-client-dropwizard: These modules provide client libraries and bundles to help with schema serialization/deserialization, HTTP communication, and integration into Dropwizard-based applications.
• Server-side Components:
• leia-dropwizard and leia-dropwizard-es: These include Dropwizard bundles that help build the schema server. They expose RESTful APIs (via resources, health checks, exception mappers) to manage and ingest schemas.
• leia-aerospike and leia-aerospike-dw: Specifically targeted at Aerospike integration with health checks and bundle support.
• leia-elastic: Manages the integration with Elasticsearch including configuration, health checks (through ElasticHealthCheck), repository access, and storage.
• leia-http-processor: Handles incoming HTTP requests for processing messages, transforming them if required, and invoking the appropriate pipelines.
• Core Schema Handling and Validation:
• leia-core: Contains the ingestion engine and processing logic for schema registration. It includes processors (Approve, Create, Reject, Update) and a central hub (SchemaProcessorHub) that ties them together.
• leia-schema-validator: Provides a validation layer, supporting both static and dynamic validation of schemas based on their structure.
• Common Libraries and Data Models:
• leia-common and leia-models: These handle shared utilities, exception codes, annotations, attribute definitions, qualifiers, and common data structures that ensure consistency across the modules.
• Infrastructure and Repository Components:
• leia-repository: Offers mechanisms to interface with a persistent store for schemas (including optional in-memory caching as suggested by the CacheConfig).
• Build Management:
• leia-bom and leia-parent: They centralize dependency management and provide a parent configuration for other modules.
Relationships and Interactions
• The client modules will interact with the Dropwizard bundles on the server side via RESTful APIs for schema management.
• The ingestion process, housed within leia-core, interacts with the validator (leia-schema-validator) and repository (leia-repository) layers to maintain the versioned schema registry.
• Modules like leia-elastic, leia-aerospike, and leia-http-processor act as connectors with external data stores or communication protocols, interfacing directly with the ingestion engine and client bundles.
• Common modules (leia-common and leia-models) are used by almost every other module to ensure standard definitions of schemas, attributes, qualifiers, and error handling.
• There is a clear maker–checker process built into the schema ingestion pipeline (from the README example) that demands custom RBAC through a SchemaUpdater that users need to implement.
Architectural Patterns and Design Principles
• Separation of Concerns: The project is divided into distinct modules, each responsible for a single area (e.g., ingestion, validation, client interface, repository), which reflects a layered architecture.
• Extensibility & Modularization: The use of Maven multi-modules (with clearly separated domains) and Dropwizard bundles indicates that new integrations and customizations (such as custom version generators or RBAC implementations) can be added with minimal changes.
• Microservice-Like Structure inside a Monorepo: Although it is organized as a single multi-module project, each module acts as an independent component that can be built, tested, and understood separately.
• Emphasis on Common Data Contracts: The heavy reliance on common models and shared libraries enforces consistency in data schema and error handling across the system.