educative.io

Concurrent request when alias is provided

I was wandering about the case when a shortening request is made with alias. In order to avoid duplicates the server should check if the alias is already used by some other url. However consider a case when the check is made for req1 but another request say req2 is made with the same alias and succeds succeeds before req1 can be saved.
Would the only solution be to have an acid database? Is there any other scalable solution in this case?