3 ms·
My first job interview out of university, I was asked how to have separate independent database servers, each able to read/write to the same status field, synch
by mnw21cam 4y ago
My first job interview out of university, I was asked how to have separate independent database servers, each able to read/write to the same status field, synchronised between them over an unreliable network, with consistent and atomic updates being written by any of the servers.
Having covered this only a year previously, my answer was that CAP theory stated that this was theoretically impossible. However, their particular actual problem was slightly more relaxed than requiring full consistency, atomicity, and partition-tolerance. The different servers could only perform limited kinds of status transition - there was no transition that could be performed on more than one server, and status transitions were mostly one-way - most of them couldn't be undone. Also, the field only had to be eventually-consistent, and updates didn't need to be ordered. So, I offered them a way to cheat by splitting the status field up into essentially a log of operations, which naturally resolved the conflicts.
I got the job.