top of page

Loan App with Microservices And Azure Cloud

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • May 4
  • 10 min read

Updated: May 5

Loan Application System – Architecture, Strategy, Blueprint, and Risk Register


📌 Business Vision

Enable a fully digital, paperless, and automated loan application and disbursement process to reduce time-to-approve from 7 days to under 2 hours, increase customer satisfaction by 40%, and ensure 100% compliance with SEBI and RBI regulations.


🎯 Business Strategy

  • Customer-centric digital loan experience

  • Reduce manual intervention through automation

  • Ensure scalability, security, and auditability

  • Enable real-time integrations with external agencies (e.g., CIBIL, eMandate)

  • Support regional deployment for compliance and low-latency performance


 Technology Strategy Aligned with Business Goals

Business Goal

Technology Enabler

KPI

Faster Loan Processing

Automated loan evaluation with Java microservices, AKS

Average loan processing time < 10 minutes

Regulatory Compliance (RBI/SEBI)

Azure Policy, Key Vault, Compliance Automation

Compliance rate > 98%

Fraud Detection

Real-time Kafka stream processing, ML model scoring

Fraud detection rate > 90%

Scalability & Availability

AKS for container orchestration, Azure Front Door, CDN

Uptime > 99.99%, Transaction throughput > 10k/s

Cost Efficiency

Azure Spot VMs, Autoscaling, Serverless Functions

Cloud cost reduction > 15%

  • Low Latency: Use Azure Front Door + CDN + AKS for regional proximity

  • Security First: Azure AD, NSG, WAF, Firewall, Istio mTLS

  • Observability: Prometheus, Grafana, ELK

  • Compliance: Encryption-at-rest, Azure Policy, audit trails

  • High Availability: Azure Load Balancer + Active-Active AKS

  • Scalability: Horizontal pod autoscaling in AKS


📈 Business Outcomes and KPIs

KPI

Target

Application-to-Approval Time

< 2 hours

Platform Uptime

> 99.9%

Fraud Detection Accuracy

> 95%

Deployment Frequency (CI/CD)

3+ times/week

Mean Time to Detect (MTTD)

< 5 mins

Mean Time to Recover (MTTR)

< 30 mins

Compliance Violations

0 tolerance


🏛️ Enterprise Architecture

Capabilities

  1. Customer Onboarding

  2. KYC Verification

  3. Credit Score Check

  4. Loan Evaluation

  5. Agreement Management

  6. Loan Disbursement

  7. Notification & Alerts

  8. Fraud Detection

  9. Reporting & Analytics

  10. Audit & Compliance

Capability to Service Map

Capability

Microservice

Customer Onboarding

onboarding-service

KYC Verification

kyc-service

Credit Score Check

credit-score-service

Loan Evaluation

loan-evaluation-service

Agreement Management

agreement-service

Loan Disbursement

disbursement-service

Notification & Alerts

notification-service

Fraud Detection

fraud-detection-service

Reporting & Analytics

analytics-service

Audit & Compliance

audit-service

Capability to Tech Map

Microservice

Tech Stack

All services

Java + Spring Boot

API Gateway

Azure API Management, Istio

Database

Azure SQL, Cosmos DB

Messaging

Azure Kafka

CI/CD

Azure DevOps, GitHub Actions

Monitoring

ELK, Prometheus, Grafana

Identity

Azure Active Directory (AAD)

Container Orchestration

Azure Kubernetes Service (AKS)


⚙️ High-Level Architecture Components

  1. Frontend (Angular/React) hosted via Azure CDN

  2. API Gateway (Azure API Management + Istio)

  3. Microservices Layer deployed on AKS

  4. Database Layer

    • Azure SQL (structured data)

    • Azure Cosmos DB (NoSQL/unstructured data)

  5. Message Bus: Azure Event Hub or Kafka on Azure

  6. Security Layer: Azure AD, NSG, WAF, Azure Firewall

  7. Monitoring/Logging: ELK, Prometheus, Grafana

  8. Automation: Azure DevOps Pipelines

  9. External Integrations: CIBIL, eMandate APIs

  10. Compliance & Audit: Azure Policy, audit-service


    High-Level Architecture Components (Azure)

    • Frontend:

      • React Web App / Mobile App hosted on Azure Static Web Apps.

    • API Gateway:

      • Azure API Management (API Gateway) + Azure Front Door for global load balancing.

    • Service Layer:

      • Java Spring Boot microservices running on Azure Kubernetes Service (AKS).

    • Data Layer:

      • Azure SQL for transactional data (loan applications, customer details).

      • Azure Cosmos DB for NoSQL data (e.g., application status, logs).

      • Azure Blob Storage for document storage (e.g., loan agreements).

    • Messaging:

      • Apache Kafka on Azure for event streaming.

    • Security:

      • Azure AD for identity management and OAuth2 for authorization.

      • Azure Firewall, WAF, and Network Security Groups (NSG) for network security.

    • Monitoring & Logging:

      • ELK stack (Elasticsearch, Logstash, Kibana) for centralized logging.

      • Prometheus + Grafana for real-time application monitoring.

    • DevOps:

      • Azure DevOps for CI/CD pipeline with Terraform/Bicep for infrastructure as code.

      • Containerized microservices deployed on Azure Kubernetes Service (AKS).

    • AI/ML:

      • Azure Machine Learning for scoring and loan risk prediction.

    • Compliance & Governance:

      • Azure Policy for enforcing governance, Key Vault for secure secrets management.


    High-Level Use Case Flows & Events

    🔁 1. LoanApplicationSubmitted

    Topic: loan-application-submittedProduced by: LoanApplicationServiceData Stored:

json

{

"applicationId": "APP123456",

"customerId": "CUST98765",

"loanType": "Home Loan",

"loanAmount": 1500000,

"tenureMonths": 120,

"submissionTimestamp": "2025-05-04T12:30:00Z",

"channel": "Mobile",

"status": "SUBMITTED"

}

🔍 2. KYCCheckCompleted

Topic: kyc-check-completedProduced by: KYCServiceData Stored:

json

{

"applicationId": "APP123456",

"customerId": "CUST98765",

"kycStatus": "VERIFIED",

"kycSource": "Aadhaar+PAN",

"kycTimestamp": "2025-05-04T12:31:30Z"

}

📊 3. CreditScoreEvaluated

Topic: credit-score-evaluatedProduced by: CreditScoreServiceData Stored:

json

{

"applicationId": "APP123456",

"customerId": "CUST98765",

"creditScore": 750,

"creditAgency": "CIBIL",

"scoreEvaluationTimestamp": "2025-05-04T12:32:00Z"

}

🧠 4. LoanDecisioned

Topic: loan-decisionedProduced by: LoanEvaluatorServiceData Stored:

json

{

"applicationId": "APP123456",

"decision": "APPROVED", // REJECTED or REVIEW_REQUIRED

"autoDecision": true,

"reasons": [],

"evaluatorEngine": "RulesV2",

"decisionTimestamp": "2025-05-04T12:32:45Z"

}

🧑‍⚖️ 5. LoanDecisionFinalized (if manual review was required)

Topic: loan-decision-finalizedProduced by: ManualReviewServiceData Stored:

json

{

"applicationId": "APP123456",

"decision": "REJECTED",

"reviewerId": "USER0012",

"comments": "Insufficient income proof",

"reviewTimestamp": "2025-05-04T13:10:00Z"

}

✍️ 6. LoanAgreementSigned

Topic: loan-agreement-signedProduced by: LoanAgreementServiceData Stored:

json

{

"applicationId": "APP123456",

"customerId": "CUST98765",

"signedVia": "eMandate + eSign",

"signingTimestamp": "2025-05-04T13:15:30Z",

"signatureStatus": "SUCCESS"

}

💸 7. LoanDisbursed

Topic: loan-disbursedProduced by: LoanDisbursementServiceData Stored:

json

CopyEdit

{ "applicationId": "APP123456", "customerId": "CUST98765", "disbursedAmount": 1500000, "bankTxnId": "TXN98761234", "disbursementDate": "2025-05-04T13:20:00Z", "notificationSent": true }

🔒 Cross-Cutting: AuditService

  • Each event includes standard headers:

json

{

"applicationId": "APP123456",

"customerId": "CUST98765",

"disbursedAmount": 1500000,

"bankTxnId": "TXN98761234",

"disbursementDate": "2025-05-04T13:20:00Z",

"notificationSent": true

}


 Cross-Cutting: AuditService

  • Each event includes standard headers:

json

{

"eventId": "UUID",

"eventType": "LoanDisbursed",

"source": "LoanDisbursementService",

"timestamp": "2025-05-04T13:20:01Z",

"correlationId": "CORR-APP123456"

}


  1.  End-to-End Architecture Text Flow (Use Case: Digital Loan Processing)

    🔹 1. Loan Application Submission

    Frontend (Web/Mobile) →Azure Front Door → WAF → Azure Application Gateway → Azure Load Balancer →LoanApplicationService (in Azure AKS)

    Flow:

    • User fills out the loan form and submits.

    • Request is routed via Front Door (global entry point), passes WAF for threat inspection.

    • App Gateway applies routing rules, forwards to Load Balancer.

    • LB sends traffic to LoanApplicationService pod in AKS (Istio mesh manages traffic internally).

    • Service validates input, generates Loan Application ID, stores it in Azure SQL.

    • Event LoanApplicationSubmitted published to Kafka.

    🔹 2. KYC Verification

    KYCService (AKS) subscribes to LoanApplicationSubmitted from Kafka.

    Flow:

    • Fetches user data and invokes external KYC APIs (e.g., Aadhaar, PAN) via Azure API Management.

    • KYC result is persisted to Azure Cosmos DB.

    • Event KYCCheckCompleted published to Kafka.

    🔹 3. Credit Score Check

    CreditScoreService (AKS) listens to KYCCheckCompleted.

    Flow:

    • Sends request to CIBIL API for credit score.

    • Parses, evaluates, stores score in Azure SQL.

    • Publishes event CreditScoreEvaluated to Kafka.

    🔹 4. Loan Evaluation and Approval

    LoanEvaluatorService (AKS) listens to CreditScoreEvaluated.

    Flow:

    • Reads application + KYC + credit score from DB.

    • Applies business rules:

      • Auto-Approve: strong score + income → event LoanApproved

      • Auto-Reject: poor profile → event LoanRejected

      • Borderline: publish REVIEW_REQUIRED → send to ManualReviewService queue

    🔹 5. Manual Review (if required)

    ManualReviewService (AKS) consumes from Azure Queue Storage.

    Flow:

    • Underwriter accesses UI (RBAC via Azure AD), reviews application.

    • On action, updates final decision → publishes LoanDecisionFinalized.

    🔹 6. Loan Agreement Signing

    LoanAgreementService (AKS) listens to LoanApproved event.

    Flow:

    • Triggers e-Sign or e-Mandate API (e.g., Digio or NSDL).

    • Once signing is successful, stores document metadata in Azure Blob Storage, status in DB.

    • Publishes LoanAgreementSigned.

    🔹 7. Loan Disbursement

    LoanDisbursementService (AKS) listens to LoanAgreementSigned.

    Flow:

    • Calls Core Banking APIs to trigger disbursement.

    • Updates ledger in Azure SQL, logs transaction.

    • Sends SMS/email notification (via Azure Communication Services).

    • Publishes LoanDisbursed.

    ☁️ Infrastructure-Level Flow (Azure Cloud)

pgsql

User → Azure CDN → Azure Front Door → WAF → App Gateway → Load Balancer

→ Azure AKS (Istio mesh) → Microservices (Java)

→ Kafka → Azure SQL / Cosmos DB / Blob / Queue Storage

→ External APIs (KYC, Credit Score, eSign)

→ Azure Monitor + ELK + Prometheus + Grafana

→ Azure DevOps CI/CD Pipelines

→ Azure AD (RBAC for UI + APIs)

→ Secure via NSG + Firewall + WAF + Private/Public Subnets in VNet


Here is the text-based architecture flow for the Loan Application System, showing all microservices, events, Kafka topics, and consumers in a step-by-step format. This simulates an architecture diagram using a structured textual layout.


🏗️ Text Version: End-to-End Architecture Flow with Microservices, Events, Kafka Topics & Consumers

1. Loan Application Submission

  • Microservice: LoanApplicationService

  • Trigger: Customer submits loan application

  • Action:

    • Validates data

    • Generates Application ID

    • Stores in DB

  • Event Published: LoanApplicationSubmitted

  • Kafka Topic: loan-application-submitted

  • Consumers:

    • KYCService

    • AuditService

2. KYC Verification

  • Microservice: KYCService

  • Trigger: Consumes from loan-application-submitted

  • Action:

    • Calls Aadhaar, PAN APIs

    • Stores KYC results

  • Event Published: KYCCheckCompleted

  • Kafka Topic: kyc-check-completed

  • Consumers:

    • CreditScoreService

    • AuditService

3. Credit Score Check (e.g., CIBIL)

  • Microservice: CreditScoreService

  • Trigger: Consumes from kyc-check-completed

  • Action:

    • Calls CIBIL API

    • Stores credit score

  • Event Published: CreditScoreEvaluated

  • Kafka Topic: credit-score-evaluated

  • Consumers:

    • LoanEvaluatorService

    • AuditService

4. Loan Evaluation & Auto Decisioning

  • Microservice: LoanEvaluatorService

  • Trigger: Consumes from credit-score-evaluated

  • Action:

    • Applies rule engine

    • Routes to:

      • Auto Approve

      • Auto Reject

      • Manual Review

  • Event Published: LoanDecisioned

  • Kafka Topic: loan-decisioned

  • Consumers:

    • ManualReviewService (for REVIEW_REQUIRED)

    • LoanAgreementService (for APPROVED)

    • AuditService

5. Manual Review

  • Microservice: ManualReviewService

  • Trigger: Consumes from loan-decisioned where status = REVIEW_REQUIRED

  • Action:

    • Assign to underwriter queue

    • Human underwriter reviews

  • Event Published: LoanDecisionFinalized

  • Kafka Topic: loan-decision-finalized

  • Consumers:

    • LoanAgreementService

    • AuditService

6. Loan Agreement Signing

  • Microservice: LoanAgreementService

  • Trigger:

    • Consumes from loan-decisioned where status = APPROVED

    • Or from loan-decision-finalized

  • Action:

    • Trigger eSign/eMandate APIs

  • Event Published: LoanAgreementSigned

  • Kafka Topic: loan-agreement-signed

  • Consumers:

    • LoanDisbursementService

    • AuditService

7. Loan Disbursement

  • Microservice: LoanDisbursementService

  • Trigger: Consumes from loan-agreement-signed

  • Action:

    • Call core banking API

    • Update ledgers

    • Send notifications (SMS/Email)

  • Event Published: LoanDisbursed

  • Kafka Topic: loan-disbursed

  • Consumers:

    • NotificationService

    • AuditService

8. Cross-Cutting Services

  • AuditService: Listens to all topics, logs actions

  • NotificationService: Sends alerts on events like approval, disbursal




🔄 High-Level Integration & Architecture Flow

  1. User initiates Loan Application via frontend (Angular/React)

  2. Request routed through Azure Front Door → App Gateway → API Gateway

  3. Request flows to onboarding-service (running on AKS)

  4. Triggers kyc-service (connects to govt KYC APIs)

  5. If KYC successful, calls credit-score-service (calls CIBIL/third-party credit APIs)

  6. Score sent to loan-evaluation-service (runs rules & eligibility engine)

  7. If eligible, agreement-service is triggered (calls eSign/eMandate APIs)

  8. Once signed, disbursement-service calls banking APIs to release funds

  9. Kafka-based messaging pushes events to notification-service, analytics-service, audit-service

  10. ELK + Grafana show real-time logs and dashboards


📘 Enterprise Blueprint

  • Domain-driven Design with Bounded Contexts

  • Shared-nothing Microservices using REST and Kafka

  • 12-Factor App Principles

  • DevSecOps: Security integrated into CI/CD pipeline

  • Policy-as-Code using Azure Policy


Enterprise Blueprint, Principles, and Standards

  • Principles:

    • Microservice-based architecture for modularity.

    • Event-driven architecture using Kafka for loose coupling.

    • Compliance-first approach for regulatory adherence.

    • Secure by design with Azure security services.

  • Standards:

    • RESTful API standards for microservice communication.

    • Version-controlled infrastructure via Terraform/Bicep.

    • Consistent CI/CD pipeline with automated testing and deployment.

  • Governance:

    • Azure Governance using Azure Policy and RBAC.

    • Regular security audits and compliance checks.

    • Architecture Review Board (ARB)

    • Compliance with SEBI, RBI digital lending norms

    • Regular audits via Azure Policy, Defender

    • Secrets rotation via Key Vault automation

Area

Standard/Principle

API Design

RESTful APIs, Swagger/OpenAPI, Idempotency

Logging

Centralized ELK, Correlation ID, PII masking

Auth & AuthZ

OAuth2, JWT, Azure AD

Monitoring

Golden signals (latency, error rate, traffic, saturation)

Resilience

Circuit breaker, retries, backoff

CI/CD

Trunk-based dev, gated release, blue-green deployment

Testing

Unit, Integration, Contract, Load Testing


🛡️ Top 40 Enterprise Risks Register


Risk ID

Risk Category

Risk Description

Priority

Mitigation Plan

R01

Business

Market demand fluctuation

High

Regular market analysis and flexible product strategy

R02

Business

Regulatory changes (SEBI/RBI)

High

Dedicated compliance team, regular updates

R03

Business

Competitive pressure

Medium

Continuous innovation and customer engagement

R04

Business

Product misalignment with customer needs

High

Customer feedback loops and agile development

R05

Business

Reputation risk due to service disruption

High

Ensure high availability with fault-tolerant architecture

R06

Business

Credit risk due to defaults

High

Strict credit assessment and scoring algorithms

R07

Business

Loan fraud

High

Real-time fraud detection with ML models

R08

Business

Inadequate pricing strategy

Medium

Market benchmarking and pricing reviews

R09

Business

Poor user adoption

Medium

User training, onboarding support, UX improvements

R10

Business

Inaccurate financial forecasting

Medium

Advanced analytics and rolling forecasts

R11

Business

Talent shortage

High

Robust hiring, training, and retention programs

R12

Business

Lack of skilled cloud resources

Medium

Certification programs and strategic hiring

R13

Business

Employee attrition

High

Engagement programs, competitive compensation

R14

Business

Change resistance from teams

Medium

Change management and clear communication

R15

Business

Inadequate training

Medium

Continuous learning and development programs

R16

Business

Operational inefficiencies

High

Process automation and monitoring

R17

Business

Downtime in loan processing

High

Redundant systems and performance SLAs

R18

Business

Manual processing errors

Medium

Automation and dual verification

R19

Business

Third-party vendor failure

High

Vendor SLAs, audits, and contingency plans

R20

Business

Delayed approvals

Medium

Process reengineering and automation

R21

Business

Scalability limitations

High

Cloud-native microservices and auto-scaling

R22

Business

Application performance issues

High

Performance tuning, caching, APM tools

R23

Business

System integration failures

High

Robust APIs, integration testing, fallback

R24

Business

Data inconsistency

High

Strong data governance, CDC, validation

R25

Business

Technical debt accumulation

Medium

Regular refactoring and architecture reviews

R26

Business

Data breach

High

End-to-end encryption and Azure security features

R27

Business

Unauthorized access

High

Role-based access control and Azure AD

R28

Business

Insider threat

Medium

Activity monitoring and behavioral alerts

R29

Business

Non-compliance with SEBI/RBI

High

Continuous compliance audits and logging

R30

Business

Weak authentication

High

Multi-factor authentication via Azure AD

R31

Business

Network vulnerability

Medium

Regular penetration tests and WAF

R32

Business

Lack of disaster recovery plan

High

Geo-redundant backup and failover

R33

Business

Ineffective monitoring

Medium

Centralized logging with ELK & alerts

R34

Business

Malware/ransomware attacks

High

Endpoint protection and anti-malware

R35

Business

Security misconfigurations

High

IaC validation and security scans

R36

Business

Cost overrun on cloud usage

High

Cost management policies and budget alerts

R37

Business

Underutilized resources

Medium

Auto-scaling and right-sizing recommendations

R38

Business

High latency for users

High

Azure CDN and edge caching

R39

Business

API rate limiting by partners

Medium

Caching and retry logic

R40

Business

Lack of observability

Medium

Implement full-stack observability with Prometheus/Grafana

R41

People

Talent shortage

High

Robust hiring, training, and retention programs

R42

People

Lack of skilled cloud resources

Medium

Certification programs and strategic hiring

R43

People

Employee attrition

High

Engagement programs, competitive compensation

R44

People

Change resistance from teams

Medium

Change management and clear communication

R45

People

Inadequate training

Medium

Continuous learning and development programs

R46

Operations

Operational inefficiencies

High

Process automation and monitoring

R47

Operations

Downtime in loan processing

High

Redundant systems and performance SLAs

R48

Operations

Manual processing errors

Medium

Automation and dual verification

R49

Operations

Third-party vendor failure

High

Vendor SLAs, audits, and contingency plans

R50

Operations

Delayed approvals

Medium

Process reengineering and automation

R51

Technology

Scalability limitations

High

Cloud-native microservices and auto-scaling

R52

Technology

Application performance issues

High

Performance tuning, caching, APM tools

R53

Technology

System integration failures

High

Robust APIs, integration testing, fallback

R54

Technology

Data inconsistency

High

Strong data governance, CDC, validation

R55

Technology

Technical debt accumulation

Medium

Regular refactoring and architecture reviews

R56

Security

Data breach

High

End-to-end encryption and Azure security features

R57

Security

Unauthorized access

High

Role-based access control and Azure AD

R58

Security

Insider threat

Medium

Activity monitoring and behavioral alerts

R59

Security

Weak authentication

High

Multi-factor authentication via Azure AD

R60

Security

Security misconfigurations

High

IaC validation and security scans

R61

Compliance

Non-compliance with SEBI/RBI

High

Continuous compliance audits and logging

R62

Compliance

GDPR non-compliance

High

Data privacy and retention policies

R63

Compliance

Inadequate audit trails

Medium

Centralized logging and versioned logs

R64

Compliance

Late regulatory reporting

Medium

Automated reporting pipeline

R65

Compliance

Policy violations

Medium

Policy training and enforcement tools

R66

Infrastructure

Network vulnerability

Medium

Regular penetration tests and WAF

R67

Infrastructure

Lack of disaster recovery plan

High

Geo-redundant backup and failover

R68

Infrastructure

Underutilized resources

Medium

Auto-scaling and right-sizing recommendations

R69

Infrastructure

API rate limiting by partners

Medium

Caching and retry logic

R70

Infrastructure

High latency for users

High

Azure CDN and edge caching

📍 Delivery Roadmap

Phase

Timeline

Milestone

Phase 1

Month 1–2

Architecture design, DevSecOps setup

Phase 2

Month 3–4

Build core microservices

Phase 3

Month 5–6

Integration with KYC, CIBIL, eSign

Phase 4

Month 7–8

Security hardening, testing, UAT

Go-Live

Month 9

Production rollout




 
 
 

Recent Posts

See All
Ops Efficiency 30 % improvement

how did you achieve 30 % operational efficiency Achieving 30% operational efficiency in a BFSI-grade, microservices-based personal...

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page