Backend Stack
The MATIH Platform backend is polyglot, using three programming languages across 24 microservices. Java dominates the Control Plane and data-intensive Data Plane services, Python powers the AI/ML services, and Node.js handles rendering. This section documents the backend technologies, frameworks, and shared libraries.
Language Distribution
| Language | Version | Service Count | Services |
|---|---|---|---|
| Java | 21 (LTS) | 17 | All Control Plane (10), Query Engine, Catalog, BI, Pipeline, Semantic Layer, Data Plane Agent |
| Python | 3.11 | 6 | AI Service, ML Service, Data Quality, Governance, Ontology, Ops Agent |
| Node.js | 20 (LTS) | 1 | Render Service |
Java Stack
Core Framework
| Component | Technology | Version |
|---|---|---|
| Application framework | Spring Boot | 3.2 |
| Security | Spring Security + custom JWT | -- |
| Persistence | Spring Data JPA + Hibernate | -- |
| Caching | Redis via TenantAwareCacheManager | -- |
| Messaging | Apache Kafka (via commons-java) | -- |
| Build tool | Gradle | 8.x |
| Container image | Distroless Java base | -- |
Key Java Libraries
| Library | Purpose |
|---|---|
commons-java | Security, multi-tenancy, persistence, caching, event streaming |
| Jackson | JSON serialization/deserialization |
| Hibernate | ORM with schema-based multi-tenancy |
| Micrometer | Metrics collection for Prometheus |
| OpenTelemetry | Distributed tracing instrumentation |
| Resilience4j | Circuit breaker and retry patterns |
Java Service Patterns
All Java services implement a consistent set of patterns from commons-java:
| Pattern | Implementation |
|---|---|
| Security filter chain | SecurityFilter --> JwtAuthenticationFilter --> TenantContextFilter --> RbacFilter |
| Tenant context | TenantContextHolder with ThreadLocal storage |
| Health checks | Spring Boot Actuator with deep component checks |
| Structured logging | Tenant-enriched JSON logs via StructuredLoggingConfig |
| API response envelope | Consistent success, data, metadata structure |
| Error handling | GlobalExceptionHandler with typed ErrorResponse |
Python Stack
Core Framework
| Component | Technology | Version |
|---|---|---|
| Web framework | FastAPI | Latest |
| Async runtime | uvicorn | Latest |
| Tenant context | contextvars (stdlib) | -- |
| LLM orchestration | LangChain, LangGraph | Latest |
| ML compute | Ray | 2.9+ |
| Build tool | Poetry / pip | -- |
Key Python Libraries
| Library | Purpose |
|---|---|
commons-python | Authentication middleware, tenant context, structured logging |
commons-ai | LLM abstractions, prompt management, RAG utilities |
| LangChain | LLM integration and chain orchestration |
| LangGraph | Multi-agent state machine orchestration |
| Pydantic | Data validation and serialization |
| SQLAlchemy | Database access (where needed) |
| httpx | Async HTTP client for inter-service calls |
Python Service Patterns
| Pattern | Implementation |
|---|---|
| Tenant context | contextvars.ContextVar for async-compatible context |
| Authentication | Middleware extracts JWT claims and sets tenant context |
| Health checks | /health endpoint with dependency verification |
| Structured logging | JSON logs with tenant context enrichment |
| Async handlers | async def route handlers for non-blocking I/O |
Node.js Stack
Core Framework
| Component | Technology | Version |
|---|---|---|
| Runtime | Node.js | 20 (LTS) |
| Web framework | Express | Latest |
| Chart rendering | D3.js, Chart.js | -- |
| PDF generation | Puppeteer | -- |
The Render Service is the only Node.js service. It handles server-side chart rendering, PDF export, and dashboard thumbnail generation.
Container Strategy
All services use a consistent container strategy:
| Aspect | Approach |
|---|---|
| Base images | Distroless (Java), python:3.11-slim (Python), node:20-slim (Node.js) |
| Multi-stage builds | Build stage compiles, runtime stage is minimal |
| Non-root execution | All containers run as non-root users |
| Health probes | Liveness and readiness probes on all services |
| Resource limits | CPU and memory limits set via Helm values |
Related Pages
- Frontend Stack -- Frontend technologies
- Data Infrastructure -- Data store technologies
- Architecture: Control Plane -- Java service details
- Architecture: Data Plane -- Polyglot service details