Part 2: Digital Wallet : The Architecture

Abhishek Ranjan
4 min readJun 11, 2023

--

Part 1 : Building a Digital Wallet : A Stroll through its Innards

Photo by CardMapr.nl on Unsplash

Overall System Architecture

To truly understand the intricacies of our architecture, we’ll break it down into microservices and their interactions. Think of our architecture like a city and the microservices as different districts, each with its own role and responsibilities.

Our city, or rather our Kubernetes Cluster, is composed of several districts (microservices) including Payment, Authentication, Notification, Settlement, Fraud Detection, Dispute Resolution, and Customer Service.

Let’s visualize it:

Overall System Design

Isn’t that a sight to behold? Now, let’s get into the details.

Load Balancer

Whenever a user sends a request, it first hits our trusty Load Balancer. The Load Balancer’s job is to evenly distribute incoming network traffic across multiple servers to ensure no single server gets overwhelmed. Imagine it as a bouncer at a club, making sure everyone gets a chance to dance.

API Gateway

Next stop on our journey is the API Gateway. It’s like the receptionist of our system, directing requests to the appropriate services. It handles routing, rate limiting, and can even modify requests or responses if needed.

Message Queue

Our Message Queue (Kafka) is like the postal service of our architecture. It allows our microservices to communicate with each other in a reliable, asynchronous manner. This comes in handy when dealing with operations that can be processed in the background.

Database

Every system needs a reliable memory, and that’s what our Database is. We use a relational database (like PostgreSQL) to store structured data like user information, transactions, etc. We also use a NoSQL database (like Cassandra) to store unstructured data or data that needs to be written or read at a high speed.

Cache

Nobody likes waiting, right? That’s why we use a Cache. It stores some data temporarily so that future requests for that data can be served faster. We usually cache data that is frequently accessed, improving our system’s overall speed and performance.

External APIs

Last but not least, we have External APIs. These are third-party services that provide additional functionality like sending emails or SMS, performing KYC checks, etc.

Microservices in Kubernetes Cluster

The heart of our system, the place where all the magic happens — the Kubernetes Cluster. Our microservices live here, each in its own little world, handling its own specific tasks. Some of the core microservices include:

Payment Microservice

The Payment Microservice handles the core functionality of our digital wallet. It takes care of processing payments and ensuring that transactions go smoothly.

All the other microservices will also have simmilar architecture as above.

Authentication Microservice

Every system needs a gatekeeper, and that’s what our Authentication Microservice does. It ensures that users are who they say they are and keeps unauthorized users out

Settlement Microservice

The Settlement Microservice is the mediator between different parties involved in a transaction. It ensures that payments are correctly settled between parties.

Fraud Detection Microservice

The Fraud Detection Microservice is the detective of our system. It monitors transactions and activities for any signs of fraudulent behavior.

Dispute Resolution Microservice

Whenever there’s a disagreement or conflict over a transaction, the Dispute Resolution Microservice steps in to resolve it.

Customer Service Microservice

The Customer Service Microservice is all about user experience. It provides assistance to users and helps them navigate through the system.

Conclusion

We took a jaunt around our digital wallet city, visiting each district (or microservice) to see what it’s all about. Our wallet isn’t just about sending and receiving money, oh no, it’s so much more than that. We’ve got a whole gang of microservices keeping the show running smoothly.

You’ve got the Payment crew handling the dough, Authentication keeping the gate, and Notification delivering the news. Settlement is the peacemaker, making sure everyone gets what they’re due. Fraud Detection’s got an eagle eye on everything, making sure nothing fishy’s going on. And if there’s a disagreement? Dispute Resolution’s got it covered. And let’s not forget the Customer Service peeps, always ready to lend a hand.

All these microservices are doing their own thing but they’re not working in silos. They’re all communicating, sharing info through Kafka, and using shared services. It’s like a well-oiled machine, with each part playing its role to perfection.

And that’s our tour done! We’ve seen how each piece fits into the puzzle and makes our digital wallet what it is — a secure, reliable, and efficient system to handle our moolah. We’ve got more to explore in part 3, where we’ll take a look at how we can develop and test our wallet. So stick around, it’s going to be a wild ride!

🔗 Connect with me on LinkedIn!

I hope you found this article helpful! If you’re interested in learning more and staying up-to-date with my latest insights and articles, don’t hesitate to connect with me on LinkedIn.

Let’s grow our networks, engage in meaningful discussions, and share our experiences in the world of software development and beyond. Looking forward to connecting with you! 😊

Follow me on LinkedIn ➡️

--

--