
At Titans, we use RabbitMQ--an open-source message broker--to manage communications between different microservices.
Let's look at what happens when a user deposits $1,000 into their Titans wallet via ACH, assuming the bank accounts are already connected and verified, it still involves a series of different microservices to handle the transaction.
First, a transaction is created for the user, with the transaction ID, user ID, and the transaction details and it gets passed to our message queue. We are dealing with real money here, it has to be accurate, robust, and fault-tolerant. Saving the transaction to the message queue allows us to resume the processing even if one of the services is down or takes a long time to process.
The payment services will monitor the queue and process the transaction by checking the payment status and update the user balance accordingly by calling the user-account-management services. Since the payment takes 1-2 business days to arrive in Titans account, the payment service also needs to monitor if the money has indeed cleared, and make it available for withdrawal, then kick off the investment services when cleared.
The investment services handle the daily rebalance of deposits and withdrawals from interest-earning platforms, conversions between Stablecoins and USD, and the composition of different Stablecoin investment ratios based on the latest rates provided by the Titans rates services. Then it will initiate transactions and monitor the statuses on crypto exchanges and listen to the events on Ethereum smart contracts.
With the message queue, we can keep each microservice relatively small. Small and simple components are less prone to errors and easy to scale, and reusable for different apps and workflows. Building modern apps is a very lego-like process, except that there is no data flow between lego pieces, but the data flow needs to be considered carefully in any app design and also the need for data security and privacy.
A simple deposit transaction actually requires a lot of work behind the scene. But for the user, it is always simple and easy to use.
Text Could be off white. Its hurting my eyes. Image too in dark mod thank you.
microservices... all the things!