Amazon Cognito | Store and sync data across devices Flashcards

1
Q

Does the number of identities in the Cognito Identity console tell me how many users are using my app?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

The number of identities in the Cognito Identity console shows you how many identities were created via the Cognito Identity APIs. For Authenticated Identities (those logging in with a login provider such as Facebook or an OpenID Connect provider), each call to Cognito Identity’s GetId API will only ever create a single identity for each user. However, for Unauthenticated identities, each time the client in an app calls the GetId API will generate a new identity. Therefore, if your app calls GetId for unauthenticated identities multiple times for a single user it will appear that a single user has multiple identities. So it is important that you cache the response from GetId when using unauthenticated identities and not call it multiple times per user.

The Mobile SDK provides the logic to cache the Cognito Identity automatically so you don’t have to worry about this. If you’re looking for a complete analytics solution for your app, including the ability to track unique users, please look at Amazon Mobile Analytics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Amazon Cognito sync store?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

The Amazon Cognito Sync store is a key/value pair store linked to an Amazon Cognito identity. There is no limit to the number of identities you can create in your identity pools and sync store. Each Amazon Cognito identity within the sync store has its own user information store.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is data saved directly to the Amazon Cognito sync store?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

No. The optional AWS Mobile SDK saves your data to an SQLite database on the local device, this way the data is always accessible to your app. The data is pushed to the Amazon Cognito sync store by calling the synchronize() method and, if push synchronization is enabled, all other devices linked to an identity are notified of the data change in the sync store via Amazon SNS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is data stored in the Amazon Cognito sync store?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Data associated with an Amazon Cognito identity are organized as key/value pairs. A key is a label e.g. “MusicVolume”, and a value e.g. “11”. Key/value pairs are grouped and categorized using data sets. Data sets are a logical partition of key/value pairs and the most granular entity used by Amazon Cognito to perform sync operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the maximum size of a user information store within the Amazon Cognito sync store?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Each user information store can have a maximum size of 20MB. Each data set within the user information store can contain up to 1MB of data. Within a data set you can have up to 1024 keys.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What kind of data can I store in a data set?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Both keys and values within a data set are alphanumeric strings. There is no limit to the length of the strings other than the total amount of values in a dataset cannot exceed 1MB. Binary data can be stored as a base64 encoded string as a value provided it does not exceed the 1MB limit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why are data sets limited to 1MB?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Limiting the data set size to 1MB increases the chances of a synchronization task completing successfully even when bandwidth is limited without lots of retries that consume battery life and data plans.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Are user identities and user information stores shared across developers?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

No, a user identity and information store is tied to a specific AWS account. If there are multiple apps from different publishers on a particular device that use Amazon Cognito, each app will use the information store created by each publisher.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can I analyze and query the data stored in the Cognito Sync store?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

With Cognito Streams, you can push sync store data to a Kinesis stream in your AWS account. You can then consume this stream and store the data in a way that makes it easy for you to analyze such as a Amazon Redshift database, an RDS instance you own or even an S3 file. We have published sample Kinesis consumer application to show how to store the updates data in Amazon Redshift.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why should I use Kinesis stream instead of a database export?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

By streaming the data to Kinesis you can receive all of the history of changes to your datasets in real-time. This means you receive all the changes an end user makes to a dataset and gives you the flexibility to store this data in a tool of your choice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What if I already have data stored in Cognito?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

When you enable the Kinesis stream feature you will be able to start a bulk publish. This process asynchronously sends all of the data currently stored in your Cognito sync store to the Kinesis stream you selected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the price of this feature?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Cognito pushes the data to a Kinesis stream you own. There is no difference in Cognito’s per-synchronization price if this feature is enabled. You will be charged Kinesis’ standard rates for your shards.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can I validate data before it is saved?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Amazon Cognito Events allows developers to run an AWS Lambda function in response to important events in Cognito. The Sync Trigger event is an event that occurs when any dataset is synchronized. Developers can write an AWS Lambda function to intercept the synchronization event. The function can evaluate the changes to the underlying Dataset and manipulate the data before it is stored in the cloud and synchronized back to the user’s other devices. Alternatively, the AWS Lambda function could fail the sync operation so that the data is not synchronized to the user’s other devices.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How is data synchronized with Amazon Cognito?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

You can programmatically trigger the sync of data sets between client devices and the Amazon Cognito sync store by using the synchronize() method in the AWS Mobile SDK. The synchronize() method reads the latest version of the data available in the Amazon Cognito sync store and compares it to the local, cached copy. After comparison, the synchronize() method writes the latest updates as necessary to the local data store and the Amazon Cognito sync store. By default Amazon Cognito maintains the last-written version of the data. You can override this behavior and resolve data conflicts programmatically. In addition, push synchronization allows you to use Amazon Cognito to send a silent push notification to all devices associated with an identity to notify them that new data is available.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a silent push notification?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

Amazon Cognito uses the Amazon Simple Notification Service (SNS) to send silent push notifications to devices. A silent push notification is a push message that is received by your application on a user’s device that will not be seen by the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do I use push synchronization?

Store and sync data across devices

Amazon Cognito | Security, Identity & Compliance

A

To enable push synchronization you need to declare a platform application using the Amazon SNS page in the AWS Management Console. Then, from the identity pool page in the Amazon Cognito page of the AWS Management Console, you can link the SNS platform application to your Cognito identity pool. Amazon Cognito automatically utilizes the SNS platform application to notify devices of changes.