Twitter API Consulting

Free Source Code: Twitter Database Server

Update Notice: I’m working on the next release (0.40) now. The new code is in a series of blog posts starting here. It is scheduled for release by the end of February.

Update Notice: The latest version (0.30) of this source code has been released on January 23, 2014. I’ve written up some notes on upgrading an installation of the previous version of this code.

This free PHP source code library is the core module of the 140dev streaming API framework. It uses the Twitter streaming API to gather tweets for selected keywords and stores them in a MySQL database. Entities within the tweets, including user @mentions, hashtags, and URLs are stored in separate tables to optimize the performance of tweet data mining. The rest of the modules in this framework use this database.

This Twitter database cache architecture has many advantages. It allows you to separate your website apps from the Twitter API, protecting your website from Twitter’s occasional performance and reliability problems.