Results 1 to 11 of 11

Thread: Convert WHMCS to use innodb / transactions

  1. #1
    Join Date
    Aug 2007
    Posts
    230

    Default Convert WHMCS to use innodb / transactions

    Hello,

    WHMCS really needs to be converted to innodb and use transactions so it's ACID (http://en.wikipedia.org/wiki/ACID). On numerous occasions (for a lot of different reasons) WHMCS has 'blow up' and then the database is left in an inconsistent state. The easiest example is that the invoice generation process blew up. You then end up with an invoice without all the invoice lines or an invoice with the header and all the lines but the next due date incorrect. If WHMCS used innodb and transactions anything that 'blew up' would get backed out and your database would be consistent and you could correct the issue and then re-process.

    Yes, I do understand that this would be a huge change to WHMCS but something as important as a billing system needs to use proper transaction management.

  2. #2
    Join Date
    May 2007
    Posts
    330

    Default

    Do a google search for ibdata1 and you'll learn that innodb can be a pain to maintain. I vote keep it the same.
    Chris

  3. #3
    Join Date
    Feb 2008
    Posts
    903

    Default

    me tooo, it's no fun...

  4. #4
    Join Date
    Aug 2007
    Posts
    230

    Default

    To be honest, I don't really care what storage engine is used, I really care about transactions (and innodb is the only one I know that supports transactions).

  5. #5
    Join Date
    Feb 2008
    Posts
    903

    Default

    I'd like to port it to MS SQL, then we could do some cool stuff, never see it happing tho

  6. #6
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    1,683

    Default

    It sounds to me like a database server issue, and not something with WHMCS. Sure, a bandaid would be to enable innodb and transactions, but perhaps you should figure out what is causing your database to "blow up."

    Are you using a dedicated server to host WHMCS? Is the database on its own box? Has mysql been tuned for the specific installation?

  7. #7
    Join Date
    Aug 2007
    Posts
    230

    Default

    The last issue we had was a bug in WHMCS. Yes, we run on dedicated hardware. Even if it was a database or server issue, WHMCS should still be using transactions. Transactions insure that "something" is completely done or completely backed out. I don't want to sound arrogant / know it all but I have 10+ years as a DBA for a fortune 200 company running very large Sybase/Oracle databases. Any transcriptional application (which WHMCS is) should use database transactions.

    When I refer to 'inconsistent' I mean logically inconsistent, not MySQL messed up. Things like invoice headers with no invoice lines (I'm not using the actual table names here).

  8. #8
    Join Date
    Apr 2009
    Posts
    138

    Default

    Also innodb is the default engine in MySQL 5.5.x

  9. #9
    Join Date
    Jul 2005
    Location
    UK
    Posts
    8,437

    Default

    Quote Originally Posted by ffeingol View Post
    The easiest example is that the invoice generation process blew up. You then end up with an invoice without all the invoice lines or an invoice with the header and all the lines but the next due date incorrect. If WHMCS used innodb and transactions anything that 'blew up' would get backed out and your database would be consistent and you could correct the issue and then re-process.
    Certainly for the scenarios you describe here this really should not be necessary. WHMCS is designed in such a way that if a line item was to be created for a product, but the process ends before the invoice generates, then it would just generate the invoice on the next cron run. And similarly if the invoice didn't include all due products for a client, then the next cron run would create an invoice for any that remain due but not invoiced. So an invoice would never get "missed" due to something unexpected causing the invoice gen routine to terminate prematurely, and next due dates increment only after payment as opposed to invoicing.

    Matt
    WHMCompleteSolution
    The Complete Client Management, Billing & Support Solution
    www.whmcs.com

  10. #10
    Join Date
    Aug 2007
    Posts
    230

    Default

    Hello Matt,

    You can look at support ticket 945646. Believe me that it did leave the database in an inconsistent state. Using database transactions just make sense in a transcriptional system like WHMCS.

  11. #11
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    1,683

    Default

    Quote Originally Posted by ffeingol View Post
    Hello Matt,

    You can look at support ticket 945646. Believe me that it did leave the database in an inconsistent state. Using database transactions just make sense in a transcriptional system like WHMCS.
    It really doesn't, and just adds headache's from a management standpoint. The way the queries are designed, a failure in a query will not cause inconsistent data. They do not need to be transactional and it just opens a whole new can of worms for the thousands of hosting companies using it.

Similar Threads

  1. WHMCS is creating accounts after failed transactions
    By dcbrit2003 in forum Customisation & Integration Questions
    Replies: 2
    Last Post: 07-10-11, 05:41 PM
  2. InnoDB vs. MyISAM
    By XPanel in forum Feature Requests
    Replies: 8
    Last Post: 03-08-11, 10:37 PM
  3. Credit Card Transactions failing in WHMCS 4.0
    By nbrooky in forum Customisation & Integration Questions
    Replies: 3
    Last Post: 08-18-09, 04:07 AM