Computing.Net > Forums > Database > MySQL: Storage Engine/Field Type

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MySQL: Storage Engine/Field Type

Reply to Message Icon

Name: mie2com
Date: September 25, 2007 at 16:17:45 Pacific
OS: XP
CPU/Ram: Pentium 4
Product: Dell
Comment:

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.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: MySQL: Storage Engine/Field Type

Can't login to mysql www.computing.net/answers/dbase/cant-login-to-mysql/303.html

Checkbox redirect www.computing.net/answers/dbase/checkbox-redirect/405.html

ACT!6 Data dictionary www.computing.net/answers/dbase/act6-data-dictionary/163.html