To prevent data corruption or inconsistencies between the local database and the Stellar blockchain, deposits and withdrawals must be processed within strict ACID transactions.
Implementation guidelines:
- Use Drizzle ORM's
db.transaction() wrapper in backend services that write savings data.
- When recording a successful deposit or withdrawal, lock the user's ledger status, insert the transaction history entry, and update the cached savings balance in a single transactional block.
- Roll back the transaction if any of the operations fail or if a conflict is detected.
Files location: backend/src/server/actions.ts, defindex_service.ts
Expected result: Database operations for savings transfers are executed safely, preventing race conditions or partial writes in the database.
Join the contributor Telegram group and ask any questions: https://t.me/+8mSQnieRmIM1Yjc0
To prevent data corruption or inconsistencies between the local database and the Stellar blockchain, deposits and withdrawals must be processed within strict ACID transactions.
Implementation guidelines:
db.transaction()wrapper in backend services that write savings data.Files location:
backend/src/server/actions.ts,defindex_service.tsExpected result: Database operations for savings transfers are executed safely, preventing race conditions or partial writes in the database.
Join the contributor Telegram group and ask any questions: https://t.me/+8mSQnieRmIM1Yjc0