Data Synchronization Example
You work in a marketing firm and business analysts in your organization need to analyze trends based on tweets on Twitter.
You use Amazon DynamoDB Connector to consolidate the tweets from various users and store the unstructured data in Amazon DynamoDB tables.
Configure a Data Dynchronization task to consolidate the tweets based on username and store them in an existing Amazon DynamoDB table.
You perform the following Data Synchronization tasks:
- Define the Data Synchronization task.
- Configure a data synchronization task to use the upsert operation.
- Create a Twitter source object.
- The source for the mapping is a Twitter object that contains the tweet details. The Twitter object is a single source in the Data Synchronization task. The Twitter object includes the TweetId, UserName, and Tweet source columns. Specify Tweets as the resource for the source object.
- Create an Amazon DynamoDB target object.
- The target for the mapping is an Amazon DynamoDB table. The Amazon DynamoDB object includes the UserName and AllTweets target columns. Provide a name test_twitter for the target object and specify the connection type as Amazon DynamoDB.
- Specify a data filter for the Twitter source object.
- Define a data filter for the Tweets source object. For example, you can filter by NoneOfTheseWords Equals 'Watch'.
- Configure a field mapping.
- Map the fields under Tweets source data to the fields in the test_twitter target object.
- To consolidate the tweets based on user name, enter the following lookup expression: concat((lookup( UserName=username ):test_twitter.tweets), Tweet
- When you run the task, the Data Synchronization application writes the mapped source data to the target Amazon DynamoDB table.
The following image shows the mapping of the Tweets source with the test_twitter target: