Which MySQL data-type to store Tweets from Twitter
database, database-design, mysql
Solution
EDIT
Twitter no longer counts user handles, among other things, against the 140 character limit, so `varchar(140)` will not be sufficient to store the entirety of long tweets with user handles in them.
However, upon inspection, I'm still not able to go over 140 characters when mentioning another twitter user via their handle.
ORIGINAL ANSWER
`varchar(140)` in the `utf8` format.
`TEXT` would be horribly inefficient. `char(140)` would waste too much space.
Not that this supports my answer, but is interesting reading nonetheless on technology and efficiency.
Problem
I need to store a great amount of twitter tweets - Which could be the best database type for tweets → best guess is just as `TEXT` - I need to prevent duplicates, too. → best guess `varchar(255)` with a `UNIQUE key` - May be `varchar(140)` character should work but we also have chinese ones? (would save a lot of Space) Another idea is, to store all tweets as `TEXT` and add another column with the Tweets hashed to MD5 and add a `UNIQUE key` over the column. Question: What's the best MySQL type to store tweets?