I've noticed that relying on one provider API can be problematic at times of heavy server load. I would like to use EthersJS to choose either Infura or Alchemy depending on which network is available at the time. I've tried using
ethers.providers.FallbackProvider as follows:
const provider = new providers.FallbackProvider([
new providers.AlchemyProvider(NETWORK_NAME, ALCHEMY_KEY),
new providers.InfuraProvider(NETWORK_NAME, INFURA_KEY),
But I've recently discovered that my app was failing to an internal Alchemy server error, even though Infura seemed to be available at the time.