Fintech goes micro, an aws serverless microservices case study
Published: 2023-05-24 12:29:23

"Crie seu banco" is a Brazilian Fintech start-up that focuses on financial services. Their CEO, Julio Cesar, aims to develop the most comprehensive "bank as a service" solution in the market, with an intelligent white label platform that is modular, flexible, and scalable.


![Serverless Microservices Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53o8ezlo4vfrbxxqlss2.png)

Many Fintechs that operate with Banking as a Service use monolithic technologies based on Laravel, which can cause issues with flexibility, modularity, and scalability. This structure requires reproducing a series of steps for each new customer to launch the solution, which creates a nightmare in terms of infrastructure and updates. Implementing a new customer can take up to six months, and each customer requires their own team to perform DevOps tasks, customization, and maintenance, making the product quite expensive.

We asked to create a solution that address those issues. So we create "Sbank," a serverless microservices architecture that minimizes the time and cost required for infrastructure management. we implemented multiple AWS services, including Amazon DynamoDB for data persistence and Amazon API Gateway for API endpoints, with AWS Lambda automating all processes from end to end.

With "Sbank," a person can now submit an online form to request a new account, and an API triggers the account-creation process. By building it on the AWS serverless platform, we achieved the goals of saving time, reducing costs, and strengthening security.
The process of acquiring new clients has gone from taking many months to just one day, reducing the cost of provisioning each account from $8000 to just shy of $500 per new client. The serverless architecture also keeps other costs down, with operational costs barely exceeding $100 a month for all the functions that support "Sbank" across all three AWS Regions. Security is now stronger, too, with "Sbank" ensuring uniform configurations and controls and providing visibility into account security profiles.

Going serverless microservices has relieved the team from managing servers and lets them concentrate on building features, creating real value in terms of time, cost, agility, and innovation.

## Using the Iac strategy

Infrastructure as Code (IaC) is the managing and provisioning of infrastructure through code instead of through manual processes. With AWS CDK, we were able to manage infrastructure deployment, destruction, and configuration. Giving us consistent, automated dev, test, and staging environments.

## Some Sbank features

### Authentication

Sbank allows users to sign in using an email and require the user to upload a document containing his or her photo. We used the AWS Amplify Framework to integrate our Front-End application with Amazon S3 and store this image in a secure and encrypted bucket. Our solution trigger a Lambda function for each new image uploaded to this bucket so that we can index the images inside Amazon Rekognition and save the metadata in a DynamoDB table for later queries.

For authentication, this solution uses Amazon Cognito User Pools combined with Lambda functions to customize the authentication flows together with the Amazon Rekognition CompareFaces API to identify the confidence level between user photos provided during Sign Up and Sign In. Here is the architecture of the solution:

![Authentication with face recognition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzu5dr0r4663yq8vq6dv.png)

### Identity Verification

In-person user identity verification is slow to scale, costly, and high friction for users. Machine learning powered facial biometrics can enable online user identity verification. We used Amazon Rekognition because it offers pre-trained facial recognition and analysis capabilities that we could quickly add to your user onboarding and authentication workflows to verify opted-in users' identity online.

This feature allow Sbank to onboard and authenticate users in seconds while detecting fraudulent or duplicate accounts. As a result, you can grow users faster, reduce fraud, and lower user verification costs.

![Authentication with face recognition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rku8p4aj7bdmi17s1v5b.png)