←Older revision |
Revision as of 20:17, 31 August 2010 |
Line 15: |
Line 15: |
| Over the (successful) years many [[good]] practices for empowering [[SQL]] in storing data has been invented. We know how to [[wikipedia:Database_normalization|normalize a database]] so it is suitable for general purpose querying. However, read the previous sentence once again. It says ''general purpose querying''. Do you think that in the internet age we need ''general purpose querying''? | | Over the (successful) years many [[good]] practices for empowering [[SQL]] in storing data has been invented. We know how to [[wikipedia:Database_normalization|normalize a database]] so it is suitable for general purpose querying. However, read the previous sentence once again. It says ''general purpose querying''. Do you think that in the internet age we need ''general purpose querying''? |
| | | |
- | Let's look at example of [[Bugzilla]]. [[Bugzilla]] is a bug tracking system backed by an [[SQL]] database. Does it help if the database is [[wikipedia:Database_normalization|normalized]]? No, not in the most common cases. | + | Let's look at example of [[Bugzilla]]. [[Bugzilla]] is a bug tracking system backed by an [[SQL]] database. Does it help if the database is [[wikipedia:Database_normalization|normalized]]? No, not in the most common case. The majority of pages displayed by [[Bugzilla]] is showing status of a bug. Such status page includes informations about the bug itself, about the list of people interested in it, about a reporter, it shows list of attachments and comments associated with the issue. Do you know what this means in terms of [[SQL]]? |
| | | |
- | ...
| + | <source lang="sql"> |
| + | SELECT few_lines FROM ISSUES, PEOPLE, COMMENTS, ATTACHEMENTS; |
| + | </source> |
| | | |
- | [[TBD]]: Why [[SQL]] is not well suited for the internet age... | + | Basically the whole universe of data is joined into a giant table and select then filters tiny piece of data associated with the desired issue. The is complete ''bulldozer'' approach - a form of [[cluelessness]]. Yes, we can use the nice [[SQL]] languages for doing [[wikipedia:relational algebra|relation algebra]], but the performance completely sucks. |
| + | |
| + | If the details of a single issue were stored in a single file (maybe under a version control system), it would be enough to read that one file to display the issue page. |
| + | |
| + | Somehow over the course of time we have forgotten that [[SQL]] is good for generating reports and started to use it for storing any kind of data. As far as I can tell, those who design heavily loaded websites have already realized that and are seeking for alternatives (like the trivial one file per bug, or [[Lucene]], etc.). |
| + | |
| + | The above critique is not meant to say that [[SQL]] is useless. Even the [[bugzilla]] has reporting pages when one can query and sort bugs by their status. For such tasks [[SQL]] is more than suitable. Maybe it is time to get back to the roots - e.g. store primary data in effective data structures and use feed the [[SQL]] with derived data ready for complex, and rare queries. |
| | | |
| <comments/> | | <comments/> |
| | | |
| {{:Talk:SQL}} | | {{:Talk:SQL}} |