educative.io

Educative

Problems with shading approach

Hi @Design_Gurus

In case where u generate photo id using time stamp, u are using two db, now it possible that u may be even number as smaller or odd number, it is not necessary that the request is increasing always until unless u force you load balancer to run round robin,but in that if one of server is having high load ,it may switch to other,but using round robin is not good thing as u have mentioned in all chapters…It is possible that i can some key as 1,3,5 from odd server then 8,10,12 from even and then 7 from odd, you see this sequence is not increasing.And if this happens in same time stamp and if all goes to same shard, it is not increasing. you cannot guarantee that u always get increasingly sorted,although u get unique, so ur purpose of sorting by creation date is not fulfilled here