Professional Web Applications Themes

client side: using load balancing and tion of mysql - MySQL

Hello I m a bit new with mysql. i want to use master/slave tion with mysql to implement load balancing. i can redirect the write to the master and use one of the slave for the read. but how the read after write should be implemented ? for exemple: -you are searching in a list of item (on a slave) -you modify an item (on a master) -you refresh the item list: as it is a read request, it should be redirected to the slave but is the slave sync'ed with master now ? if not, the user will not ...

  1. #1

    Default client side: using load balancing and tion of mysql

    Hello

    I m a bit new with mysql.
    i want to use master/slave tion with mysql to implement load
    balancing.
    i can redirect the write to the master and use one of the slave for the
    read.

    but how the read after write should be implemented ?
    for exemple:
    -you are searching in a list of item (on a slave)
    -you modify an item (on a master)
    -you refresh the item list:
    as it is a read request, it should be redirected to the slave
    but is the slave sync'ed with master now ?
    if not, the user will not see his update and he can think that he has to
    modify again the item.

    what is the best way to handle this case :
    - refreshing from master after modif ?
    - waiting than the slave is sync'ed ?
    - other ?



    patrice Guest

  2. #2

    Default Re: client side: using load balancing and tion of mysql

    patrice wrote: 
    mysql tion is designed to be almost synchronous. i suggest that
    you run this command

    SHOW SLAVE STATUS\G

    on your master server, then look at the parameter seconds_behind_master.
    it should be close to zero if you have a good network.
    lark Guest

  3. #3

    Default Re: client side: using load balancing and tion of mysql

    "lark" <net> a écrit dans le message de
    news:_QTbi.3695$news.prodigy.net... 

    thank you for the answer.
    i ve effectively noticed that the slave is quickly updated.
    but i guess it can exists some situation where the slave is not updated
    immediatly (if multiple write are already pending)

    so maybe i have to record a counter for each table in a special table,
    inc'it at each update, and wait
    (with a timeout the user can cancel) until the counter on the slave is >=
    before resending the query from the slave.





    patrice Guest

Similar Threads

  1. Load Balancing 101
    By Rick W in forum Coldfusion Server Administration
    Replies: 2
    Last Post: January 30th, 10:18 PM
  2. Replies: 3
    Last Post: February 13th, 06:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139