Distributed Systems
- gRPC service boundaries
- contract-first APIs
- remote failure handling
- service-owned data
- optimistic concurrency
Reference Implementation
A public reference implementation for contract-first gRPC services, service-owned persistence, durable diagnostic workflows, security boundaries, reliability controls, and OpenTelemetry-based observability.
Stack
What This Demonstrates
Problem And Constraints
Many sample microservice systems either collapse data ownership into one shared database or expand into platform scope before contracts, trust boundaries, and failure behavior are clear. This reference keeps the domain intentionally small so reviewers can inspect the engineering choices directly.
System Architecture
JWT + RBAC
service-owned persistence
Telemetry path
The runtime centers on Catalog and Diagnostic services. Callers authenticate at service boundaries, Diagnostic performs Catalog lookups through a gRPC client where required, each service persists through its own PostgreSQL ownership boundary, and telemetry flows through OpenTelemetry into local observability tools.
Service Responsibilities
Owns
Exposes
Depends on
Persistence
Catalog-owned PostgreSQL schema and application role
Owns
Exposes
Depends on
Persistence
Diagnostics-owned PostgreSQL schema and application role
Request Flow
A caller submits a diagnostic request to the Diagnostic Service. The service authenticates and authorizes the caller, checks Catalog where service eligibility is required, persists the accepted job and idempotency record, and returns a bounded response.
Create Diagnostic Job request flow: Caller sends a request through JWT authentication and RBAC to the Diagnostic Service. Diagnostic Service performs a gRPC lookup to Catalog Service as a downstream dependency, then writes to Diagnostic Job Persistence and returns a response.
Downstream dependency
gRPC lookup
Where controls apply
Engineering Decisions
Reliability And Failure Model
Implemented behavior
Requests fail closed before protected service behavior executes.
Implemented behavior
The owning service rejects the operation through RBAC authorization.
Implemented behavior
Diagnostic-to-Catalog calls are bounded by deadlines and documented error translation.
Implemented behavior
The service returns a bounded failure rather than waiting indefinitely.
Implemented behavior
Concurrent stale updates are rejected rather than silently overwriting service metadata.
Implemented behavior
Readiness and persistence paths surface failure through service status and errors.
Implemented behavior
Server lifecycle code is designed to stop accepting work and shut down cleanly.
Security Boundaries
then
then
then
Observability
Verified Behavior
Catalog accepts valid service registration through the documented gRPC API.
Duplicate Catalog records are rejected through documented service behavior.
Catalog retrieves registered service metadata by identifier.
Catalog update paths use version-aware conflict behavior.
Diagnostic accepts job creation requests after authorization and Catalog validation.
Diagnostic exposes retrieval for accepted jobs.
Catalog and Diagnostic services expose gRPC health responses.
The reference repository documents validation across service, repository, transport, auth, and reliability paths.
Trade-offs And Limitations
Future Extensions