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

I've seen something very similar to the Sequence key table. But there wasn't just one of them, it was a common pattern. And it had 2 rows and 2 columns.

The reason we had it is we had master-master replication, but without requiring the peer to acknowledge befor committing a transaction. To avoid inconsistencies, we preferred one server for even ids and the other for odd ids. But when writing a new record, an autogenerating sequence would just give the next id without regard to what "side" the request was on. So we had a table to keep track of the next id to use for each side, where we incremented the next id by 2 each time a new id was allocated.

It was a little weird, but it worked fairly well. Although we eventually changed the architecture and removed the need for those tables.



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

Search: