Enterprise Microservices Banking Platform
MicroBank360 is a production-grade banking platform built on modern microservices architecture principles, designed for scalability, resilience, and maintainability. The system implements core banking functionalities with clean separation of concerns and well-defined service boundaries.
Each service can be independently scaled based on demand, with Eureka handling service discovery for dynamic scaling.
OpenFeign with client-side load balancing ensures resilient inter-service communication with automatic retry mechanisms.
Reactive programming model in the API Gateway ensures non-blocking I/O for high throughput scenarios.
Each service maintains its own database, enforcing strict boundaries and enabling independent evolution.
Dedicated Data Seeder Service with circuit breakers and batch processing for scalable data generation.
Built-in CSV export capabilities for JMeter and other performance/load testing tools.
The platform currently implements three core microservices with well-defined boundaries and comprehensive APIs:
Manages all customer-related data and operations with full CRUD capabilities and account relationship management.
CREATE TABLE customers ( id BIGINT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(100) UNIQUE NOT NULL, phone VARCHAR(20) NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP );
Handles all account operations including creation, balance management, and customer account relationships.
CREATE TABLE accounts ( id BIGINT AUTO_INCREMENT PRIMARY KEY, account_number VARCHAR(20) UNIQUE NOT NULL, account_type ENUM('SAVINGS', 'CURRENT', 'LOAN') NOT NULL, balance DECIMAL(15,2) NOT NULL DEFAULT 0.00, customer_id BIGINT NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, );
MicroBank360 implements a dedicated Data Seeder Service as a standalone microservice for generating realistic test data at scale. This production-grade approach separates data generation concerns from business logic while providing comprehensive testing capabilities.
Method | Endpoint | Description | Request Body | Response |
---|---|---|---|---|
GET | /customer |
List all customers with their accounts | None | Customer[] |
GET | /customer/{id} |
Get customer by ID with accounts | None | Customer |
POST | /customer |
Create new customer | CustomerDTO | Customer |
PUT | /customer/{id} |
Update customer | CustomerDTO | Customer |
DELETE | /customer/{id} |
Delete customer | None | 204 No Content |
{ "name": "string (required, min 2)", "email": "string (required, email format)", "phone": "string (required)" }
{ "id": "long", "name": "string", "email": "string", "phone": "string", "createdAt": "timestamp", "updatedAt": "timestamp", "accounts": "Account[]" }
Method | Endpoint | Description | Request Body | Response |
---|---|---|---|---|
GET | /account |
List all accounts | None | Account[] |
GET | /account/{id} |
Get account by ID | None | Account |
POST | /account |
Create new account | AccountDTO | Account |
PUT | /account/{id}/{balance} |
Update account balance | None | Account |
DELETE | /account/{id} |
Delete account | None | 204 No Content |
GET | /account/customer/{customerId} |
Get accounts by customer ID | None | Account[] |
{ "accountNumber": "string (required)", "accountType": "enum (SAVINGS|CURRENT)", "balance": "decimal (min 0)", "customerId": "long (required)" }
{ "id": "long", "accountNumber": "string", "accountType": "string", "balance": "decimal", "customerId": "long", "createdAt": "timestamp", "updatedAt": "timestamp" }
Method | Endpoint | Description | Parameters | Response |
---|---|---|---|---|
POST | /seed/customers/{count} |
Generate specified number of customers | count (path) | CustomerResponse[] |
POST | /seed/accounts |
Generate accounts for existing customers | minAccountsPerCustomer, maxAccountsPerCustomer | AccountResponse[] |
POST | /seed/full-dataset |
Generate complete dataset (customers + accounts) | customerCount, minAccountsPerCustomer, maxAccountsPerCustomer | DatasetResponse |
GET | /seed/export/jmeter-data.csv |
Export JMeter-ready combined data as CSV | None | CSV File |
GET | /seed/export/customers.csv |
Export all customers as CSV | None | CSV File |
GET | /seed/export/accounts.csv |
Export all accounts as CSV | None | CSV File |
GET | /seed/stats |
Get seeding statistics | None | StatisticsResponse |
DELETE | /seed/cleanup |
Clean up all seeded data | None | 200 OK |
The Data Seeder Service is implemented as a reactive microservice with fault tolerance
Reactive WebClient with circuit breaker integration
Resilience4j configuration for fault tolerance
Start the Data Seeder Service and generate test data
The Eureka server acts as the central registry for all microservices, enabling dynamic service discovery and load balancing.
# application.yml eureka: client: registerWithEureka: false fetchRegistry: false server: enable-self-preservation: true eviction-interval-timer-in-ms: 5000
The Spring Cloud Gateway serves as the single entry point for all client requests, handling routing, load balancing, and cross-cutting concerns.
spring: cloud: gateway: routes: - id: customer-service uri: lb://CUSTOMER-SERVICE predicates: - Path=/customer/** - id: account-service uri: lb://ACCOUNT-SERVICE predicates: - Path=/account/**
Services communicate through REST APIs using OpenFeign for declarative client creation, with Spring Cloud LoadBalancer distributing requests across available instances.
Fault tolerance implementation in our Data Seeder Service, providing resilient inter-service communication with automatic failure detection and recovery.
Data Seeder Service implements full reactive programming using WebFlux and WebClient for high-throughput, non-blocking data generation and CSV export operations.
Test data generation infrastructure built into our Data Seeder Service, featuring realistic data creation, batch processing, and comprehensive CSV export capabilities.
Data export system built into our Data Seeder Service, providing JMeter-optimized CSV files for performance testing and data analysis.
Our system implements multiple communication patterns: synchronous OpenFeign for Customer↔Account communication, reactive WebClient with circuit breakers for Data Seeder operations, and centralized routing through the API Gateway.
Resilience4j implementation with separate breakers for Customer and Account services, preventing cascade failures in our data generation pipeline.
Exponential backoff retry (3 attempts, 1-second intervals) integrated with our WebClient calls for transient failure recovery.
10ms request delays and batch processing (100 records) to prevent overwhelming target services during large data generation operations.
Flux.range() for data generation, Flux.buffer() for batching, and Mono responses for non-blocking high-throughput operations.
Configurable batch sizes with delayElement() for rate limiting, processing thousands of records efficiently without memory issues.
Built-in health endpoints (/seed/health) and statistics tracking (/seed/stats) with real-time generation metrics and timestamps.
# Clone the repository git clone https://github.com/PritiAryal/MicroBank360.git cd MicroBank360 # Build all services mvn clean package
Create databases and configure connection strings:
# For Customer Service CREATE DATABASE microbank_customer; # For Account Service CREATE DATABASE microbank_account; # For Eureka Server (if using persistence) CREATE DATABASE microbank_eureka;
Configure application.yml
in each service:
spring: datasource: url: jdbc:mysql://localhost:3306/microbank_customer username: dbuser password: dbpassword driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: ddl-auto: update show-sql: true
Start services in the following order:
# 1. Eureka Server cd eureka-server mvn spring-boot:run # 2. Customer Service cd customer-service mvn spring-boot:run # 3. Account Service cd account-service mvn spring-boot:run # 4. API Gateway cd api-gateway mvn spring-boot:run # 5. Data Seeder Service cd dataSeederService mvn spring-boot:run
Verify services are registered in Eureka dashboard at http://localhost:8761
Use the Data Seeder Service to populate the system with test data:
# Generate 500 customers POST http://localhost:8088/seed/customers/500 # Generate accounts for customers (1-2 accounts per customer) POST http://localhost:8088/seed/accounts?minAccountsPerCustomer=1&maxAccountsPerCustomer=2 # Generate full dataset in one call POST http://localhost:8088/seed/full-dataset?customerCount=250&minAccountsPerCustomer=1&maxAccountsPerCustomer=2 # Export data for JMeter GET http://localhost:8088/seed/export/jmeter-data.csv
Use Postman or curl to test the API endpoints through the gateway (default port 8080):
# Create a customer curl -X POST http://localhost:8080/customer \ -H "Content-Type: application/json" \ -d '{"name": "John Doe", "email": "john@example.com", "phone": "+1234567890"}' # Create an account curl -X POST http://localhost:8080/account \ -H "Content-Type: application/json" \ -d '{"accountNumber": "ACC123456", "accountType": "SAVINGS", "balance": 1000, "customerId": 1}' # Get customer with accounts curl http://localhost:8080/customer/1
MicroBank360 includes a comprehensive JMeter Performance and Load Testing Suite with automated performance and load testing capabilities, multiple scenarios, and professional reporting.
JMeter test plans with configurable parameters and shell script automation.
CSV-driven testing with realistic data exported from the Data Seeder Service.
# Default: 10 users, 120 seconds ./quick-microbank360-test.sh # Custom: 5 users, 60 seconds ./quick-microbank360-test.sh 5 60 # Custom with different server ./quick-microbank360-test.sh 20 300 staging.com
# Run all test scenarios ./run-microbank360-tests.sh # Run specific test scenario ./run-microbank360-tests.sh baseline ./run-microbank360-tests.sh load ./run-microbank360-tests.sh stress ./run-microbank360-tests.sh spike # Custom server configuration ./run-microbank360-tests.sh load localhost 8084
The JMeter tests generate comprehensive results for analysis:
# Sample Results from working-results.jtl timeStamp,elapsed,label,responseCode,responseMessage,threadName 1752999113372,180,Health Check,200,OK,Simple Test Group 1-1 1752999115229,578,Customer 1,200,OK,Simple Test Group 1-2 1752999117858,72,Account 1,200,OK,Simple Test Group 1-1