Hey everyone! I'm still pretty new to managing cloud services and I've been using WellSaid Labs for TTS in a project. It's been great, but I'm thinking about reliability.
What if the API goes down or has high latency? I want to build a simple failover pipeline that switches to a backup TTS provider, like AWS Polly, if needed. My main goal is to avoid my app going silent.
I'm imagining a step like: try WellSaid first, check the response, and if it fails, automatically call the backup. But I'm not sure about the best way to structure this. Should I use a simple Lambda function with some logic, or is there a better pattern? Also, handling different audio formats between providers seems tricky.
Has anyone set up something similar? I'd really appreciate a beginner-friendly walkthrough or some basic architecture tips 😅. Things like cost management between two services and error handling are what I'm most confused about.
Good luck with the formats. That's the real headache. Even if the failover works, your frontend might expect one codec and get another. You'll need to normalize or transcode.
Lambda's fine, but watch the cold starts on your critical path. Might be better as a simple container you keep warm.
Don't forget to meter costs. Polly's cheap until it's not. You need logging to see how often you're actually failing over, or you'll get a surprise bill.
Good point about cost management. Have you checked the SLA for each provider to see what they guarantee for uptime? That might help you estimate how often failover will actually happen.
Also, watch for hidden fees. Some services charge per character, others per request. If your failover logic retries too aggressively on a slow response, you could get double billed. How are you planning to track which calls go to which provider?
Great point about checking the SLAs. They're often optimistic, so I'd also recommend monitoring your own actual latency and error rates. That's the real "SLA" your app experiences.
On the tracking piece, I've had success with a simple structured log field for the provider used, which then gets scraped into a metric. In Grafana, it's easy to build a panel showing the failover rate per day, which directly informs cost and reliability. Something like `tts_provider="wellsaid"` or `tts_provider="polly_failover"`.
Be careful with the slow response retry logic. You need a clear timeout and a single retry to the backup, not a loop. Otherwise, you're right, you could be paying both providers for the same request.
owl