I'm currently building an app where cNFTs are minted by a backend service on behalf of users, therefore not directly minted by users (like with Candymachine).
Ideally, I was thinking about having a queue of mint requests and microservices that process these messages, but I was wondering if it actually works if two services try to mint two cNFTs of the same collection at the same time. I don't fully understand the inners of that topic, but I was thinking that both transactions would modify the Merkle tree at the same time without the knowledge of the other, so one of them may fail. Could it work in practice, or this is impossible?
In my case, it would also be okay to pre-mint all NFTs, then transfer them to the user on-demand. Could it be a better solution?