Twootr! is my playground to learn about some technologies that the cool kids have been playing with. I've wanted to learn more about messaging systems and large dataset management, so when someone told me about some example code that ships with yajl-ruby that fetches tweets from Twitter's Streaming API, I decided that would be a really solid data source.
I'm also interested in playing with Hadoop and similar data manipulation tools down the road.
Iteration One: It used to be that the twoots would go directly into an unstructured postgres table with a couple of flags to note whether they'd been put into CouchDB or MongoDB yet. This got untenable, as every time I wanted to add a new storage backend, I needed to add a new flag column. With 10 million records, that took forever.
Iteration Two: So, I've moved to a queueing system. Now the twoots come straight off the API into a queue called "intake". This allows us to remove some non-twoot API responses before persisting to the backends. It also has the side benefit of removing the fetcher's need to know what storage backends we're using... another process will come by later and take care of putting the twoots into queues for the storage backends.
Next Up: Explore using RabbitMQ's fanout exchanges so a message can be published and appear in each of the backend queues.
Copyright (c) 2010, Ben Bleything firstname.lastname@example.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.