Hi everyone. Currently, I'm learning PHP/MySQL by writing a script for a simple blog.
I need advice/opinion from anyone experience working with MySQL regarding my decision of storage engine and field type.
Table Name: post_page
Description: Storing data for each new post to blog.
Storage Engine: MyISAM
Reason: According to this articles(http://linuxplanet.com/linuxplanet/tutorials/6034/5/), MyISAM engine is design in mind with 90% of the access to database as reads, rather than writes. Since I'm making a web log, I don't think I would involve with transaction, so I guess this would be a perfect match for web log database.
Field #1: global_key
Type: MEDIUMINT, SIGNED, NOT NULL
Description: This will be a reference key to 'comments' table. For each new post, this would be assign such as "totalpost+1", starting from '1' and maximum count to '16777215'.
Reason: Since TINYINT(SIGNED) is max at 255, and SMALLINT(SIGNED) is max at 65535, I choose MEDIUMINT in case I would make more than 65535 posts in the future.
Field #2: date
Type: DATE, NOT NULL
Field #3: time
Type: TIME, NOT NULL
Field #4: title
Type: MEDIUMTEXT, NOT NULL
Description: This would be title for blog entry.
Reason: By looking at newspaper as example, sometimes the title for certain news is quite a long string. This is the reason why I choose MEDIUMTEXT instead of TINYTEXT.
Field #5: entry
Type: LONGBLOB, NOT NULL
Description: This would be blog entry, the main content.
Reason: In WYSIWYG, I have an option whether to insert object(image/swf/etc) from url, or, upload to website itself. If I choose upload, this will be stored in database. I'm not very sure of database performance consequences, but the reason I did this is, it would be easier to manage. This is also the reason I choose LONGBLOB instead of LONGTEXT. Another reason is, in case I would make a post that involve something like 4 pages of an article, I think only LONGBLOB would be fit.
Field #6: tags
Type: TINYTEXT, NOT NULL
Description: This would describe category of blog entry.
I'm not very sure particularly with my decision on storage engine, field #1, and field #5.
Thanks in advance.