Skip to the links

Call Me Al

My MozBlog

When you think of something called "database.mozdev.org," you probably think of it as actually using a database. Its not. It is a collection of XML files. The extensions come to more than 150 KB and the themes come to more than 100 KB. Whenever a theme is updated, one of our members must update the file and do a cvs checkin. Updates can sit around for weeks before someone decides to make the changes.

It started off as a desire by me to have a gui add and update entries. Not only would I be more willing to make changes, but I would be able to do it at work from behind the corporate firewall. What if a theme author was able to update their own listing? This might encourage an author to keep the database up-to-date instead of just emailing us.

Keeping the information in XML files is not a terrible idea. Changes are tracked via CVS. While reading XML can be done easily enough, inserting new nodes, writing out the XML, and checking it in via php isn't. Themes are maintained in themes.xml as well as loadFBThemes.js and loadTBThemes.js. They are not kept synchronized. We do have an XML to JS and JS to XML synchronizer, though. Eventually Themes.m.o, FBH Themes, and TBH Themes will all use themes.xml. ExtensionRoom, FBH Extensions, and TBH Extensions already share extensions.xml. That is what database.mozdev.org is all about.

Each time someone visits the page, extensions.xml is loaded into memory, parsed, and then presented. Databases tend to be faster than plain text files, especially if result-sets are cached. Mozdev.org has MySQL installed, so I think we should take advantage of it. I think that the current 5 XML files should be re-arranged into tables in a database. This would also help enforce referential intengrity and prevent misspellings of attribute names. More querying options would become readily available, including listing themes and extensions by author. Why write complicated php code when a simple SQL query can do it for you?

I have filed these bugs to help us stage things.

  1. Create database structure (Bug 5557)
  2. Populate lookup tables:
  3. Import existing data:
  4. Export database to xml and javascript for backward compatibility
  5. Create sample pages displaying database info
  6. Create sample pages for db.m.o staff to update lookup tables
  7. Create sample pages for db.m.o staff to update data tables
  8. Create sample pages for end-users to update data tables
0 comments - Post a Comment


powered by blogger