Read from global slave?

I’ve been thinking about adding the ability to have a slave for the global db (for reads). Does anyone have any thoughts on this? Is it needed, etc.

Thanks,

Andrew

  • Luke
    • The Crimson Coder

    Both, really. At least I think that’s where it’s going, with an emphasis on load.

    Reads are cheap, as we all know. That being said, the global DB is getting read across all blogs, where individual DB’s are read as needed.

    So a DB only serving reads is a lot faster than one doing writes (insert or update, but updates being the “slower” of the 2).

    However, something that is interesting to think about is that the global tables don’t experience many writes overall in the big picture. Most of the queries are just lookups, with an occasional insert.

    That and you would have to add in replication, and trickle it down, plus when an insert/update to the master global is added, you’d have to do the same query on the slave. Or, set it up as replication.

    I don’t think it would hurt anything though.

    What were your thoughts for it, Andrew?

  • Andrew
    • Champion of Loops

    Well, if you just have the default global tables then it wouldn’t really be useful. However, once you start adding custom features that utilize global tables and also make a lot of writes then it could become quite useful.

    Sorry for the lack of intelligent replies today. For some reason I can’t seem to concentrate on anything at the moment. Just one of those days…

    Thanks,

    Andrew

  • Luke
    • The Crimson Coder

    Andrew, you’re closer to Charlotte, you wanna drive up there and set Doc straight? lol

    I see exactly what you mean though, Andrew. Although there would have to be replication going on for that.

    But, while we’re on the subject, I “got into something” late last night, and have done something similar.

    I set up a “custom” db, where I’m throwing some extra stuff.

    I’m going to have 2 tables in there that will be written to on every click that isn’t in wp-admin/.

    What I’m considering, is actually having 4 tables. The main two, and then two read tables.

    How I’m thinking of doing this is once an hour, the back ups will be deleted, and then the mains will be copied to a new backup.

    Although, I’m not sure if that would be the way to go, or if just copying a database to another one would be better.

    I’m still in the initial thought process at the moment.