It would be nice if MongoDB could build a queue system on the server side where if multiple concurrent transactions hit the database at the near-same instant of time, instead of throwing a “WriteConflict” error, it would build a queue on its side and process the request when the write conflict no longer persists. The caller will keep the connection open. This would avoid the latency overhead that comes with the network hops while going back to the caller, and then them retrying. If there is the option to queue concurrent transactions and then return whenever after the transaction can atomically go through without causing a write conflict, it would save network overhead in case the caller plans on re-pinging with the same request.
1 Like