I want to store messages received from a server in some kind of database. My web site is based on Drupal and i am using Mysql database. The messages contain 6 field ( 2 strings and 4 integers). Upon storage these messages would be constantly queried for and also updated.
Which开发者_如何学运维 approach should i go for here. A drupal CCK field or a MySql database table?
It depends. CCK's schema was designed more for flexibility than for being "constantly queried." If you don't expect your schema to change much over time and you have the ability to create and manage your own tables, you might not get much benefit from CCK. If you ever decide to export your data to a system other than Drupal, it would probably be easier from the simple table structure that you'd get from creating your own custom tables.
However, if you're in a hurry for some reason, you can probably create a single content type with the fields you describe in about 15 minutes. If you want support for the Views module, that's already included with CCK.
If you have legacy data in a database, or have your database filled trough some external process, CCK is not an option. CCK allows you to modify fields in a web-interface; but, in doing so, you change the underlying database structure. CCK also depends on its own database structure, there is no way you can make CCK grab content from a legacy or none-CCK database, or to push content in there, without writing all the CCK fields yourself.
精彩评论