This process needs to receive tweets from the Streaming API (however we decide to filter them in #3), store them in the database, and remove old ones so we don't have an unmanageable number of tweets. This can be time-based (using Tweet.created_at) or we can have a set number of tweets in the database (maybe 10000) where for each new tweet received we delete the oldest.
This series of three tutorials (127, 128, 129) might help: http://railscasts.com/episodes/127-rake-in-background and http://railscasts.com/episodes/366-sidekiq
This process needs to receive tweets from the Streaming API (however we decide to filter them in #3), store them in the database, and remove old ones so we don't have an unmanageable number of tweets. This can be time-based (using Tweet.created_at) or we can have a set number of tweets in the database (maybe 10000) where for each new tweet received we delete the oldest.