Data Authority Module Structure
Overview¶
A Data Authority Module consists of three distinct layers:
- Protocol Adaptor Layer: Responsible for handling the communication protocols that expose the module’s API Endpoints. It handles protocol data marshalling and unmarshalling, entity identities, and routing of requests to the appropriate operations in the Service Layer.
- Service Layer: Contains the business logic and operations of the module. Services in this layer support the inspection and modification of the state of the entities managed by the module. A Service may implement operations that affect multiple entities and types of entities and may also access other modules’ API Endpoints through proxies representing the API Endpoints and capabilities of those other modules.
- Persistence Layer: Responsible for the storage and retrieval of entity values. It provides a consistent interface for the Service Layer to interact with the underlying data store, abstracting away the details of how data is persisted and supporting journalling and other data lifecycle support.
- Proxy Layer: is responsible for providing access to the API Endpoints of other modules. It allows the Service Layer to interact with other modules’ capabilities without needing to know the details of their implementation or location in the runtime environment.
Endpoints¶
API Endpoints are the means for a module to expose its capabilities to other modules and external systems. Each modle may expose multiple API Endpoints.
Endpoints may be Request/Response or Streaming endpoints.
Request/Response endpoints specify a set of operations, each of them defined by a Pair<Request, Response>. Operations always specify a response to their request, although the response may be a simple acknowledgement of the request. Operations can be either synchronous or asynchronous, and may even specify multipart or stream request types.
Streaming endpoints produce or consume a stream of Notifications. They are usually Asynchronous but in rare cases they may be synchronous if the underlying protocol handles it.
Endpoints are implemented using a specific protocol, such as HTTP/REST and gRPC for Request/Response endpoints or SQS, WebSockets, Kinesis or Kafka for Streaming endpoints. The protocol adaptor layer is responsible for handling the specifics of the protocol used by the endpoint.
Structure of a Data Authority Module¶
Code Structure¶
TBD. See examples in item-data-authority repository.