Design of an Internet Banking System with AWS
Design of an Internet Banking System with AWS
by Fausto Iván Zamora Arias
In today’s digital era, online banking systems have become essential for delivering secure, efficient, and user-friendly financial services. This article presents a comprehensive design for a modern Internet Banking System, leveraging proven cloud technologies and architectural best practices. By breaking down the system through multiple levels of abstraction—from high-level context and container diagrams to detailed internal components—you’ll discover how each part interacts to provide seamless authentication, robust transaction handling, multi-channel notifications, and reliable data auditing. Whether you’re a developer, architect, or simply interested in fintech, this overview offers valuable insights into building scalable and secure banking solutions.
Level 1: Context Diagram
The system interacts with 7 main actors:
- Bank Client: End user who accesses services through frontend applications.
- Web Application (SPA): Single Page Application accessible from a web browser.
- Mobile Application: Designed for smart devices (smartphones and tablets).
- Online Banking System: Intermediary between frontend and backend, processing requests (e.g., transfers) and coordinating execution with the banking core and databases.
- Banking Core: Manages critical data such as customer information, transactions, and historical movements.
- Complementary System: Provides additional and specific customer data.
- External Notification Service: Sends alerts and messages to the client through two cloud-based channels.
Level 2: Container Diagram
Frontend: User Applications
- SPA (Single Page Application) and Mobile App: Users interact via browser (SPA) or smartphone (app).
- SPA uses ReactJS, deployed with Amazon CloudFront.
- Mobile app recommended frameworks: React Native (preferred for JavaScript/TypeScript consistency) or DotNet MAUI (for C#/fintech environments).
- Developed in ReactJS.
- Deployed on Amazon CloudFront for global distribution and low latency.
- Recommended: React Native (consistency, Meta support, ongoing updates).
- Shares logic with SPA, facilitating cross-platform development.
- Alternative: .NET MAUI (C#, ideal for fintech/banking teams).
Authentication and Onboarding
- Separate containers for Authentication and Onboarding (registration).
- Both use Amazon Cognito for user storage and authentication.
- Shared user/client database for movements, activities, and audit.
- Managed by Amazon Cognito (credential storage and validation).
- Independent flow, integrated with Cognito.
- Records additional data in shared database (for movements and audit).
Backend for Frontend (BFF)
- Executes logic accessible only via bank's internal network/VPC.
- Communicates with frontend using JWT from authentication.
- Performs interbank transactions, updates client data, and maintains frequent user cache.
- Exposes internal bank APIs (protected by JWT).
- Operates within bank’s VPC for security.
- Executes interbank transactions (via Banking Core).
- Updates client data and maintains cache of frequent users.
Data Persistence (BFF)
- Two solutions for user data: Redis (fast key-value, in-memory) and DynamoDB (fast by primary/secondary key; optimal for reconciliation).
- Redis: Ultra-fast in-memory key-value storage.
- DynamoDB: Optimal for user ID lookups and data reconciliation.
Notification Microservice
- Microservice focused on notifications, fed by BFF logic.
- Listens to SQS for events/messages from Banking Core, publishes to SNS and Firebase Cloud Messaging.
- Supports multichannel notification requirements (SMS, email, push).
- Listens to Amazon SQS for Banking Core events (e.g., deferred transfers).
- Publishes messages to:
- Amazon SNS: Multichannel (SMS, email, push).
- Firebase Cloud Messaging (FCM): Real-time push to SPA and mobile app.
Audit and Data Consolidation Service
- Aggregates data from Banking Core, BFF, and clients in a relational database.
- Two options: Scheduled ETL (AWS Glue) every 6 hours, or DynamoDB Streams for real-time data transformation to PostgreSQL.
- Aggregate data in relational DB (e.g., PostgreSQL).
- Scheduled ETL (AWS Glue): Serverless processing every 6 hours.
- Real-Time Streams: DynamoDB to PostgreSQL, immediate data replication.
Level 3: Internal Architecture
Frontend: Architecture and Controllers
- Two applications: SPA (ReactJS, AWS CloudFront, S3) and Mobile App (React Native or DotNet MAUI).
- Four controllers:
- Authentication: Login via username/password or biometric.
- Banking Operations: Update, transfer, movement, client profile.
- Image Processing: Photos/images for Rekognition.
- Notifications: Real-time via Firebase Cloud Messaging.
- Single Responsibility Principle (SOLID) for controller separation.
- FCM for cross-platform notifications, Rekognition for AI-based identity.
Authentication and Onboarding Microservice
- Lambda-based microservice for user authorization and biometric onboarding (Amazon Cognito API for JWT/auth).
- Auth flows divided into lambdas: Auth Challenge Definition, Creation, Verification, Biometric Logic, Rekognition Controller.
- Separate flows for authentication and onboarding, sharing core logic.
- User enters credentials on frontend.
- Frontend sends request to authentication service (Amazon Cognito).
- Cognito returns access token.
- Token used in other apps (e.g., BFF).
- User registers and uploads photo via frontend.
- Photo sent to authorization service and stored in Cognito user pool & S3.
- Rekognition compares photo, indexes in DynamoDB (Facial ID Table).
- Frontend requests authentication with photo/email; Cognito triggers lambdas for challenge/verification.
- Upon successful verification, JWT token is issued for use with BFF.
- Amazon Cognito stores login/authentication data.
- Frontend should monitor onboarding/auth steps via Google Analytics.
Backend for Frontend (BFF): Orchestration Layer
- Microservice logic, implemented as AWS Lambdas.
- Uses Authorizer Lambda (validates JWT via Cognito OAuth 2.0 secret).
- API Gateway to expose lambdas securely.
- Business lambdas for transfers, balance inquiries, profile updates (all interact with Banking Core).
- Persistence: DynamoDB (write) & Redis (frequent reads, cache).
- Writes: DynamoDB
- Reads: Redis
Notification System: Asynchronous Events
- Uses Amazon SNS (email/SMS) and Firebase Cloud Messaging (in-app notifications).
- Banking Core publishes messages to SQS, notification lambda transforms and delivers to SNS/FCM.
- DynamoDB ("Notifications DB") logs all message deliveries.
- Multichannel notifications (SMS, email, push).
- Decoupled architecture—Banking Core doesn’t need to know final destinations.
Audit: Data Consolidation
- Strategies for audit database covering all client interactions.
- Assumes all services have own microservice DBs except Banking Core (hosted in AWS RDS).
- Recommended solutions: CDC (Change Data Capture) with DynamoDB Streams, or ETL with AWS Glue.
- DynamoDB Streams capture changes.
- Lambdas transform and load into Aurora PostgreSQL.
- Strength: Real-time, ideal for immediate reconciliation.
- Scheduled job (e.g., every 6 hours) via AWS Glue.
- Extracts data from DynamoDB/RDS, transforms to S3, loads into Aurora.
- Strength: Cost-effective for non-critical real-time data.
- Use CDC for transactions (movements).
- Use ETL for historical reports.
Comments
Post a Comment