Sep 16 2022
Aug 31 2022
Resource
BlogTopic
Edge DeliveryDate
May 21, 2019Software engineer Nick Schwab was the first third party developer to create ambient noise apps for Amazon’s Alexa in 2016. And the apps were a big success: Only a year after publishing them, Schwab was helping more than 100,000 people sleep, meditate and relax every day.
Serving this many people translated to delivering 40 terabytes of audio per day. And because smart devices like the Amazon Echo have limited memory, all of this audio was streamed.
“One unique thing about voice apps is that the smart devices they rely on stream the app’s content straight from the Internet,” Schwab told us during an interview. “The devices don’t actually cache the content or download it. So every time a user listens to the ambient sounds, the audio is streamed from the server you manage.”
Because of this, you can’t host the content for Alexa Skills on any old server. Doing so will cause latency and timeouts.
In the case of Schwab’s apps, timeouts would equate to people getting less sleep. When issues like this occurred, people did not hesitate to leave 1-star reviews, which put the visibility and consumer trust of Schwab’s apps at risk.
With a growing business and hundreds of thousands of users depending on his apps to improve their lives, Schwab was determined to find a solution to eliminate timeouts and improve his business.
To stream sounds with as little latency and interruption as possible to users, Schwab started using a content delivery network (CDN). With the CDN, audio was streamed from servers on the CDN that were geographically closer to users—rather than from Schwab’s single origin server that was further away.
In theory, using a CDN would eliminate any timeout issues related to network performance. When people were playing the ambient sounds on their Alexa device, their experience would not be interrupted with a sudden silence or unwanted noise the ambient sound was drowning out (e.g. dog barking in neighboring apartment).
In one too many instances, however, this theory remained just that—a theory. Schwab’s CDN was outperforming the single origin server, but network-related timeouts were still happening. This created unexpected pauses and delayed response times to Alexa commands.
Even though Schwab’s application servers were fast and reliable, occasional timeouts and connectivity issues with his audio file CDN would bring small waves of negative reviews.
“There were stability issues with my initial CDN provider,” said Schwab. “I would see some connections drop off and users were complaining about the content not being accessible. And since my apps are used on a nightly basis by thousands of people, timeouts truly affect their lives. Because of this, they aren’t shy about leaving one-star reviews.”
CDNs are merely a collection of servers located in different areas of the world. Anyone can build a CDN. Even the least experienced developer can do it in an hour. But not everyone can build an edge network.
Among other things, a true edge network has servers that are located right in the middle of Internet exchanges all over the world. These placements put content a 0-ms distance away from the internet service providers (ISPs) that bring content (I.e. packets of audio files) to the homes of Alexa users.
In theory (again), a CDN provider with an edge network would eliminate latency issues that occurred with the “traditional CDN” that Schwab was using.
To test this theory, he spoke with three CDN providers that were known for their performance and connectivity. All of them gave him competitive pricing, but there were differences in how pricing was delivered that made one better than the rest.
CloudFlare—Schwab had used CloudFlare for projects in the past, but even as a paying customer it was difficult to get timely and effective customer support. He also read reports of customers getting shut down without any prior warning or being pushed into an expensive enterprise plan for surpassing undisclosed bandwidth limits. “Getting somebody sucked in and then flipping the switch doesn’t seem like a good way to do business,” said Schwab.
AWS—Amazon offers significant pricing discounts for many of their AWS services, but they often come with a caveat: signing a long-term contract. Although Schwab happily uses many AWS services for his business, getting locked into a long-term financial commitment didn’t make sense for his startup. “Customer growth has been outstanding over the past several years, but I couldn’t afford to have my company’s cash-flow committed to minimum monthly quotas,” said Schwab.
StackPath— Unlike CloudFlare, Schwab found bandwidth pricing that was clearly presented. And unlike AWS, competitive pricing was available on a month-to-month basis. No contracts were necessary. This way, if a sudden traffic shift or an improvement in audio file compression lowered his bandwidth consumption, Schwab wouldn’t be stuck paying for nothing.
Schwab ended up going with StackPath, but not only because its pricing model complements his use case. He also appreciates the team behind the service. “StackPath’s customer service is what made my decision final,” Schwab said. “StackPath is super responsive to emails and always ready to hop on phone calls.”
With his previous CDN provider, he had to wait up to 30 minutes to hear back about an issue, which was too long given the amount of people who use his apps. Also, the performance of the CDN could hardly be called “performant.” To compare, he said downloading an audio file from his previous CDN took a minute. With StackPath, it takes less than a second.
Now, Schwab is starting to see fewer 1-star reviews related to latency and more 5-star reviews related to the awesomeness of his app.
To get similar 5-star reviews and eliminate latency-related issues, developers can experiment with StackPath’s service that Schwab uses for audio streaming. This works well for Alexa skills and other sound-focused apps, plus the free trial comes with 1TB of delivery.
You can also get inspiration for developing top-rated sound apps for Alexa and other voice-enabled platforms by checking out Schwab’s suite of apps that are published under his company Invoked Apps.