Strategies for managing high-traffic balances and preventing lock contention in Blnk.
skip_queue: true
), leading to transaction failures and poor user experience.
This guide covers strategies for handling hot balances effectively in Blnk, ensuring reliable transaction processing even under high load.
skip_queue: true
, they must acquire distributed locks to maintain balance integrity. If a lock isn’t acquired, the transaction fails with a Failed to acquire lock
error.
This becomes problematic for hot balances that receive:
Remove skip_queue parameter
skip_queue
parameter or set it to false
. This routes transactions through the queue system.Listen for webhook events
transaction.applied
- Transaction successfully processedtransaction.rejected
- Transaction rejected (insufficient funds, etc.)transaction.inflight
- Transaction held in inflight stateTrack transaction status
parent_transaction
or reference
:skip_queue: true
for hot balances, implement your own concurrency controls to prevent race conditions:
Implement sequential processing
Add retry logic
Customer balance → GL Balance
Use: Customer balance → Customer hold balance → GL Balance
Create customer hold balances
Process customer transactions immediately
skip_queue: true
since each customer has their own hold balance, eliminating competition for locks.Settle to GL balance via queue