Skip to content

5. Architecture

This section is the engineering view of the platform. It translates the product modules and the integrations into a deployable, scaleable, audit-ready shape — with concrete artefacts (DDL, sequence diagrams, API contracts, worked data) rather than abstractions alone.

PagePurpose
5.1 High-level architectureLayers, deployments, multi-AZ shape, request flows
5.2 Services and modulesModular monolith vs microservices; module boundaries; extraction triggers
5.3 Core data modelConceptual entity catalogue with relations
5.4 Events and asyncEvent bus, idempotency, retries, DLQ, event sourcing
5.5 Workflow and rules enginesWorkflow engine choice + rule engine choice with rationale
5.6 Data platform and warehouseOLTP vs OLAP split, ETL, dbt, BI, feature store
5.7 Security, IAM, auditSSO, RBAC, secrets, PII vault, audit log integrity, IT-MD alignment
5.8 Sequence diagramsMermaid sequence diagrams for the 8 core flows
5.9 Schema referenceFirst-cut PostgreSQL DDL per module
5.10 API catalogue40+ key APIs with payloads and conventions
5.11 Worked data exampleOne synthetic borrower’s data at every stage
5.12 Development conventionsRepo structure, Spring Boot skeleton, testing, CI/CD, code review
  1. Module boundaries follow product boundaries. Each major product module from Section 3 is a logical service / package with a defined public API. Cross-module access happens via API, not direct database joins.

  2. Sync read paths, async write fan-out. A sanction event triggers documentation, disbursement queue, reporting, analytics; these are async, not chained synchronous. Loose coupling buys reliability.

  3. Idempotency everywhere. Every state-affecting external API call carries an idempotency key; every consumer dedupes. Retry-safe by default.

  4. PII minimisation by tokenisation. Sensitive PII (PAN, Aadhaar, mobile, bank account) is tokenised at the boundary; clear text lives in the PII vault and is accessed only by services with explicit need. The main DB carries tokens only.

  5. Event sourcing for accounting-affecting flows. Every loan-affecting event is an immutable record in loan_event. Current state (current_outstanding, current_classification) is a materialised projection. History is the ground truth; current state is derived.

  6. Multi-AZ from day one; multi-region by year 2. RBI IT MD expects geographic separation between primary and DR. Mumbai primary, Hyderabad DR.

  7. Java / Spring Boot bias. Engineering team strength; mature fintech ecosystem. See Section 14 for stack specifics.

  8. Buy primitives, build orchestration and domain. KYC / BSA / AA / GST / eSign / NACH are bought; underwriting / co-lending / reconciliation / portfolio analytics are built.

The choice tree, in dependency order:

  • Modular monolith first (5.2) → drives the package structure (5.12) and the schema layout per module (5.9).
  • Sync REST + async events (5.4) → drives API patterns (5.10) and event topic taxonomy.
  • Workflow engine for long-running orchestration (5.5) → drives sequence-diagram patterns for sanction-to-disbursement, settlement, restructuring (5.8).
  • OLTP / OLAP split (5.6) → CDC out of PostgreSQL; warehouse drives reporting and analytics.
  • PII tokenisation + audit hash chain (5.7) → required from day one; expensive to retrofit.
  • Frontend architecture for the borrower portal, partner portal, admin console, field-agent app. These are mostly conventional React / React Native applications; their architecture is uncomplicated by the platform’s standards and lives in their own repos.
  • Frontend design system / component library — relevant but separate concern.
  • Marketing site, growth dashboards, content tooling — out of platform scope.
  • Finance / treasury system — typically a separate ERP / accounting tool (Zoho / Tally / NetSuite) integrated rather than built in-platform.