Planning for future load balancing

Discussion in 'Programming' started by Cobnut, Jun 26, 2008.

  1. #1
    We're just starting development on a project that may in the future require some load balancing on the back end, either MySQL, web serving or both. This will almost certainly be handled by our clients' in house IT support but I was wondering if we need to do anything special with our code/classes to make the process more robust.

    We'll be authoring in PHP and using MySQL so, for example, I've heard it suggested that we should use InnoDB rather than MyISAM.

    Are there any things we should bear in mind to make sure our programming is ready for load balancing, or is it completely invisible?

    Sorry if this is a silly question, it's not something we've had to worry about previously.

    Jon
     
    Cobnut, Jun 26, 2008 IP
  2. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #2
    Load balancing requires different type of coding altogether like choose a random mysql server and then query , if you do not take care of possible load balancing in future you will repent , you might have to rewrite the code.
     
    it career, Jun 26, 2008 IP
  3. roym

    roym Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Not sure about mysql, but normally the db load balancing is something that can be handled purely on the database side depending upon the db engine you go with (though with MS you will need a plugin for true load balancing), suggest you research this before going any further. Furthermore my suggestion would be to design the app in a way that there are seperate classes for communincating with the db, and other external services. That way rather than having to change the entire application if you encounter scalability problems you only have to change the classes that handle the communication. And when coding keep in mind that user's may be jumping between servers so do not store anything on the local web server instead access a comon store (probably the db) through a seperate communication class.
     
    roym, Jun 26, 2008 IP