Amazon Mobile Analytics Auto Export
You can use Amazon Mobile Analytics to collect, visualize, and understand app usage data at scale. Mobile Analytics can automatically export event data from your apps to an Amazon S3 bucket or an Amazon Redshift cluster using an AWS CloudFormation stack created in your account. This data auto export makes it possible for you to analyze app usage in detail and combine this information with other business intelligence data.
Amazon S3 buckets provide secure, durable, highly scalable object storage. Amazon Redshift is a fast, fully managed, petabyte-scale data warehouse solution that makes it simple and cost-effective to efficiently analyze all of your data using your existing business intelligence tools. AWS CloudFormation provides an easy way to create and manage a collection of related AWS resources.
If you have not already done so, first create an app and generate events before setting up auto export. For more information about creating and app and generating events, see Getting Started.
Auto Export Overview
The analytics collected by Mobile Analytics result from events sent by your app that are collected, aggregated, and then used to populate the console reports and custom dashboards. Mobile Analytics retains this data for 25 months; however, you can't directly access this data for custom analysis. To keep this data for longer than 25 months or to perform custom analysis using your own custom queries and tools, you must export the data for storage.
Mobile Analytics provides an auto export capability that stores your incoming data, either to an Amazon S3 bucket alone or to both an Amazon S3 bucket and an Amazon Redshift cluster. Mobile Analytics will create the Amazon S3 bucket or Amazon Redshift cluster when you set up auto export, or you can use an existing Amazon S3 bucket or Amazon Redshift cluster.
By default, auto export of your data is not enabled. You can choose to enable auto export any time, either for specific apps individually or for all of your apps. Data export for an app begins when auto export is enabled for that app, retaining your data from that time forward.
Mobile Analytics auto exports using a single configuration, so when you set up auto export for the first time you must choose between export to Amazon S3 alone or to both Amazon S3 and Amazon Redshift. That configuration, including the destination Amazon S3 bucket or Amazon Redshift cluster, then applies to the auto export of all apps for which you have enabled auto export.
When exporting to Amazon Redshift, an Amazon EC2 instance is created. This instance reads the data that is written to the Amazon S3 bucket and then loads that data into the Amazon Redshift cluster.
Writing Events to Amazon S3
Auto export to Amazon S3 writes each file to the designated bucket three times:
First write: Approximately five minutes after receiving the event
Second write: Approximately one hour after receiving the event
Third write: Approximately twelve hours after receiving the event
Mobile Analytics does this to address certain edge cases in which some Mobile Analytics events may not be available until twelve hours later. In most cases, the majority of a user's Mobile Analytics events are exported in the first write operation. However, if you trigger an Amazon S3 notification event based on data written to your Amazon S3 bucket, by invoking an AWS Lambda function for example, the Amazon S3 notification event will be called three times.
Event data is written to .gz archive files per hourly time slice in which events were received. If the volume of received events is high in any time slice, the archive of event data may be written in multiple parts. The path and file naming used to write the archive of event data follows this pattern:
The name of the destination Amazon S3 bucket.
The application ID GUID.
The four-digit year.
The two-digit month.
The two-digit day.
The two-digit hour of day.
The two-digit minute.
The four-digit part number of the event archive.
Connecting to Amazon Redshift
Amazon Redshift provides multiple ways to connect to an Amazon Redshift cluster, including programmatic access via a JDBC connection, or querying Amazon Redshift directly on your workstation using SQLWorkbench/J. For more information, see Connecting to an Amazon Redshift Cluster.
When logging in to your Amazon Redshift cluster, use the Amazon Redshift connection string which is located in the
Amazon Redshift console on your cluster's configuration page. For more information, see Configuring
Amazon Redshift Connections. Then use the
eventreader user name and the
eventreader password you specified in the auto export configuration to
connect to the cluster.