educative.io

Workaround for single KGS single point of failure

As explained, to prevent single point of failure for KGS, we can provide 2 database one generating odds and the other even numbers. Sure this will help solve the single point of failuer problem, but it doesn’t solve the problem that the PhotoID stored might be not incrementing right ?

It solves the problem for auto-increment also. It could generate a separate database instance to generate auto-incrementing IDs.

hmm really ? I am thinking of this scenario:
let’s say currently we are using the odd generated id from KGS. lets say the last entry has Id=5. Then suddenly there is failure on this database server, because of this, we will be using the even generated id from KGS (starting from Id=2). This way the entry with PhotoId=2 will come after PhotoId=5, right ?