Seamless Transactions: Golang’s Guide for Gen X, Y, & Z
summary
Shows Go code that implements DB transactions with a concrete transfer coins between accounts example: repository + service layers, SQL updates, and a bank_records insert; introducing an injected error triggers transfer example rolled back on error so balances and records remain consistent. Presents a reusable ExecuteTransaction closure that begins, runs a passed function, commits on nil error and rollbacks otherwise. Advises keeping transactions scoped, stress testing, and compensating non-transactional stores.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 2:19Database transactions
- 4:17Money transfer scenario
- 7:29Go transactions
- 13:07Generic execution method
- 15:39Conclusion
related talks
22mOff the Chain: Scaling Blockchain in Go
23mImplementing Event-driven Systems with Go
55mBuilding a Bank with Go
19m"Off the Chain! Scaling Blockchains in Go"
24mMastering Concurrency in Go: From Patterns to Production
33mRuby and Go
43mWhy Use GO in Financial Services
39mHow to test Go code with a database?
