5
As Bumciach mentioned there are likely things that can be done to optimize queries and such.
I believe from looking at the code Xoops is based on the 10+ year old MySQL connector code and is based off early MySQL 4.x.
MySQL 5.x has brought MANY new things to the table. You can switch to the newer MySQLi Connector stuff to take advantage but there really is no point at this stage. If you are going to switch to a new system then it is better to move to a universal system such as PDO because it will take the same or maybe even less work. With few exceptions other than the connection string , by using PDO we can also support any of the PDO supported databases out of the box. Both PDO and MySQLi support the latest MySQL.
From my experience a number of developers have directly accessed MySQL from their modules for a variety of reasons(Speed, convenience, security, lack of knowledge of API functions). Going to PDO or even MySQLi may break some of those modules. PDO will help to facilitate other Optimizations and should have an immediate impact. A big reason a lot of sites now use PDO is also because of the fact it is much more secure than MySQL connect commands. By its design of using Prepared statements and some other features is MUCH more secure than MySQL. It is much harder for someone to "forget" to sanitize data since some of this PDO does automatically.
Another thing to look at is the Database Table Type that we use.
We use MyISAM with XOOPS and vast majority of Modules. We should consider looking at basing the Databases Types off InnoDB instead. I believe MyISAM is an older type and the InnoDB was created at a later time to support many of the newer functions.
Taken from:
http://www.mysqltutorial.org/understand-mysql-table-types-innodb-myisam.aspxQuote:
The most important feature to make all the table types above distinction is transaction-safe or not. Only InnoDB and BDB tables are transaction safe and only MyISAM tables support full-text indexing and searching feature. MyISAM is also the default table type when you create table without declaring which storage engine to use. Here are some major features of each table types:
Only listing the relevant table types here for Brevity. If you want to know more go to the listed site.
Quote:
MyISAM
MyISAM table type is default when you create table. MyISAM table work very fast but not transaction-safe. The size of MyISAM table depends on the operating system and the data file are portable from system to system. With MyISAM table type, you can have 64 keys per table and maximum key length of 1024 bytes.
InnoDB
Different from MyISAM table type, InnoDB table are transaction safe and supports row-level locking. Foreign keys are supported in InnoDB tables. The data file of InnoDB table can be stored in more than one file so the size of table depends on the disk space. Like the MyISAM table type, data file of InnoDB is portable from system to system. The disadvantage of InnoDB in comparison with MyISAM is it take more disk space.
I have read elsewhere that MyISAM generally is faster for large databases with few linked tables. I have read that the InnoDB datatable type was created to support many of the new features of MySQL 5.x.
From what I have read it looks like we would benefit greatly by moving to InnoDB as the database type.
My impression by using InnoDB and PDO it will allow us to implement quite a number of optimizations we are limited from doing now. I find it curious though that PDO talks about working with transactions but doesn't suggest that it requires using InnoDB when using MySQL.
Attending College working towards Bachelors in Software Engineering and Network Security.