Skip to content
Back to Projects
05/Enterprise MicroservicesBackend & Cloud Architect2024 – Present

Novent Backend

A robust backend system featuring NestJS microservices with Hexagonal Architecture and CQRS, leveraging Postgres, Redis, Kafka, Debezium, and Meilisearch.

Tech StackNESTJSKAFKAPOSTGRESQLREDISDEBEZIUMMEILISEARCHCQRSGRPC
Closed source
Novent Backend
Overview

Problem & solution scope

Novent Backend is an enterprise-grade distributed microservices platform engineered for high-concurrency event handling and financial transactions. Utilizing Hexagonal Architecture (Ports and Adapters) with Command Query Responsibility Segregation (CQRS), it decouples domain logic from external transport layers while ensuring sub-millisecond data synchronization via Apache Kafka and Debezium Change Data Capture (CDC).

System Architecture

System architecture

Hexagonal (Ports & Adapters) Microservices with CQRS & Event-Driven CDC

Composed of an API Gateway, Core Business Service, and Financial Service communicating via gRPC and Kafka. Database changes to PostgreSQL are streamed in real-time by Debezium into Kafka topics, where search workers ingest them into Meilisearch, maintaining eventual consistency without application-level double writes.

System Components

API Gateway

NestJS / tRPC / Express

Central entrypoint managing JWT authentication, permission guards, request routing, rate limiting, and tRPC contracts.

Core Service

NestJS / Hexagonal / CQRS

Houses core business domains, command handlers, domain event publishing, and entity state management.

Financial Service

NestJS / gRPC / Double-Entry Ledger

Manages transactional accounting, wallet balances, and invoice settlement with ACID consistency.

Event Streaming & CDC

Apache Kafka / Debezium / Meilisearch

Streams Postgres Write-Ahead Logs (WAL) through Kafka for decoupled cache invalidation and full-text search indexing.

Data & Execution Flow

01
Request Ingress & Auth

Client requests hit Gateway via tRPC or REST; validated by central PermissionsModule.

02
CQRS Command Dispatch

Commands route to Core Service via gRPC; domain aggregate executes invariants and persists to PostgreSQL.

03
Change Data Capture (CDC)

Debezium detects PostgreSQL WAL updates and streams structured change events onto Kafka topics.

04
Asynchronous Search Indexing

Search consumers read Kafka events and update Meilisearch indexes, ensuring zero lag on query workloads.

Key Capabilities

Engineered capabilities

[01]

Strict Hexagonal Architecture: Complete decoupling of Domain, Application, Infrastructure, and Presentation layers.

[02]

CQRS Command/Query Separation: Separates read-heavy query pipelines from write-heavy command handlers.

[03]

Change Data Capture (CDC): Debezium connector monitoring Postgres WAL for reliable, atomic event propagation without dual-write bugs.

[04]

High-Speed Inter-Service RPC: Microservices communicate internally over binary gRPC protocols.

[05]

Distributed Caching & Search: Redis for session and hot-key cache; Meilisearch for typo-tolerant full-text search.

Technical Decisions & Trade-offs

Engineering trade-offs

Debezium CDC over Manual Event Publishing

Extracting domain events directly from Postgres WAL guarantees that every committed transaction produces a message, eliminating dual-write failure vulnerabilities.

Monorepo Package Modularization

Shared DTOs, gRPC clients, logger, and permission guards live in isolated packages (@packages/*), ensuring consistency across all microservices.

Back to ProjectsClosed source