Design Considerations for Your Streaming Application
Streaming your application from the cloud offers several advantages over running it natively on consumer devices: you can run a complex application on simple devices, support new consumer devices without updating your application, seamlessly provide new versions of your application to clients, and improve the security of your code.
In exchange for these advantages, however, you have some new requirements to take into consideration when building your application:
Continuous network connection—A application requires a continuous network connection. What user experience will you offer your customers when the network is unavailable? You might show them an error message, or—in the case of a hybrid application—provide them access to the portion of your application that can function offline, running entirely on the consumer device.
Managing latency—Streaming your application from Amazon AppStream adds sources of latency, a small amount of latency from Amazon AppStream overhead as well as variable latency from network conditions. While in many cases, the added latency will be imperceptible to your users, your application needs to be able to tolerate some latency and to handle latency spikes gracefully.
Persistent storage—When you stream your application from Amazon AppStream, it runs on Amazon AppStream hosts in the cloud. When a client session ends, the Amazon AppStream host resources are recovered and any data stored locally on the Amazon AppStream host is lost. If your application needs to persist state between user sessions, you'll need to record that data in a persistent data store (such as Amazon S3, Amazon RDS, or DynamoDB) before the client session ends and load the data from the persistent store when the next client session begins.
Redirecting video and audio output and user input—In order to stream your application across Amazon AppStream, you'll need to redirect the output to application libraries provided in the Amazon AppStream SDK, and implement interfaces that listen to events from those libraries.
Client application renders video at 720p— Although the server can run an application at any video resolution, the client application can only render video at 720p. Your application must have a 720p video resolution mode.
Hybrid applications—Will you stream your entire application from Amazon AppStream or perform some processing on the consumer device? Hybrid applications can offer solutions for both loss of network as well as handling latency spikes. One way to use Amazon AppStream is to run basic application functionality on the consumer device and enhance the experience when a network is available, such as a game with basic character animations rendered on the device with enhanced graphics and detailed backgrounds available through streaming.
Applications with zero tolerance for latency are not recommended for streaming, such as first-person shooter games or player vs. player fighting games. For these types of applications, consider building a hybrid experience where the latency intolerant aspects of the experience are run locally on the consumer device, while other aspects of the experience requiring cloud resources are streamed.