Menu
Amazon AppStream
Developer Guide

This documentation is for an older version of Amazon AppStream. For information about the latest version, see the Amazon AppStream 2.0 Developer Guide.

Storing Persistent Data

When you host your application on Amazon AppStream, your application runs on an Amazon AppStream host in the cloud. When the session ends, the Amazon AppStream host is recycled, and any data stored on the Amazon AppStream host is lost. If your application needs to persist data between sessions, it should record the data in a persistent data store before terminating the session. You can record the data to a physical server or store the data on AWS using a service such as Amazon S3, Amazon RDS, or DynamoDB.

The XStxServerManager object fires an XStxIServerManagerListenerFcnServerSaveState event before terminating a session to give your application a chance to record data before the session ends. To do this, provide an implementation of XStxIServerManagerListenerServerSaveState that records data to a persistent data store.

The following excerpt from the sample streaming application shows an implementation of XStxIServerManagerListenerServerSaveState. It is from ServerManagerListener.cpp. This file is in the <SDK_dir>\example_src\server\common directory. This implementation does not persist data, but the comment shows where you would add that functionality.

Copy
XStxResult ServerManagerListenerImp::XStxIServerManagerListenerServerSaveState( XStxServerHandle session, uint32_t timeout, XStxStopReason reason) { // Add code here to record data to a persistent data store return XSTX_RESULT_OK; }