# DynamoDB Aggregator Experiment
This script serves as a demonstration of how message aggregation could function using DynamoDB as a store of events. Events are buffered by **event_type** and **profile** then processed after a delay according to **event_type**. 

## Setup
1. Make sure your AWS environment is pointing to `dev`.

2. Create virtual environment and install package
	```
    $ python -m venv env
    $ source env/bin/activate
    $ pip install -r requirements.txt
    ```
    
3. Add event(s)

    Valid event types are `trending_track` and `playlist_placement`.

    ```
	$ python run.py add_event 1 trending_track A insights
    ```

    * ARGV[1] => `event_id`
    * ARGV[2] => `event_type`
    * ARGV[3] => `profile_id`
    * ARGV[4] => `profile_type`
    
4. Process queue(s)

	```
    $ python run.py process_queue
    ```

	* `trending_track` events aggregate in 15 second window
	* `playlist_placement` events aggregate in 60 second window
