Learn how and why Blnk queues transactions.
When multiple users interact with a financial system simultaneously, ensuring accurate and consistent transaction processing becomes crucial. Blnk handles this challenge through a concurrency control system that combines two key mechanisms: transaction queuing and optimistic locking.
In this guide, you’ll learn how these mechanisms work together to streamline transaction processing, prevent data conflicts and maintain system integrity.
Blnk’s architecture incorporates queuing and optimistic locking to manage concurrency as illustrated below:
Simplified overview of how Blnk manages concurrency
This diagram illustrates Blnk’s layered architecture where transactions enter through the API layer and are then routed to the appropriate service based on the details of the transaction.
Queuing transactions act as a buffer to manage the flow of transactions to ensure sequential processing for similar operations. The database layer, equipped with optimistic locking, is where the final check for version consistency occurs, ensuring that only transactions based on the current state of the data are applied.
The queuing system manages transaction flow through partition-based processing. When transactions enter the system, they are routed to specific queue partitions based on their characteristics. Similar transactions affecting the same balance are grouped in a single partition, ensuring sequential processing order.
Key aspects of the queuing system:
Blnk’s transaction system ensures idempotency through reference value tracking. When multiple instances of the same transaction occur due to network or system errors, the system:
reference
valueThis mechanism prevents double processing and ensures consistent ledger entries, eliminating the risk of duplicate debits or credits.
The optimistic locking mechanism complements the queuing system by providing conflict resolution at the data layer. Instead of locking resources preemptively, the system:
This approach maximizes throughput while maintaining data consistency. When conflicts occur, indicating that another transaction has modified the data since it was last read, the system initiates a rollback and retry process.
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.
To ask questions or discuss issues, please contact us or join our Discord community.