Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think a lot of databases would disagree


You can implement two-phase commit instead. It requires a bit of additional planning in terms of data management but I actually find it much more elegant and it scales better. DB transactions are expensive and unnecessarily complicated.

You can have a really simple two-phase commit system where you initially mark all records as 'pending' and then update them as 'settled' once all the necessary associated rows have been inserted into their respective tables. You can record a timestamp so that you know where to resume the settlement process from. I once had multiple processes doing settlement in parallel by hashing the ids to map to specific processes so it scales really well.


>"You can implement two-phase commit instead"

Two-phase commit is a particular way of implementing transaction when system is distributed. There is no "instead" here


System doesn't have to be distributed. In general it just needs to separate the insertion of records from their settlement.


You might be on to something here ;)


But they are web scale!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: