10 rows is just an example, but replacing 1 MB for 100 bytes change every time there is an update the overhead is more than 99%.<br><br>How about using the same methodology that xdelta is using to do the binary patching, also the client doesn't have to know anything about the offset, he just need to call a function "Update" with the right key, the server should handle the patching not the client.
<br><br><div><span class="gmail_quote">On 8/30/07, <b class="gmail_sendername">dormando</b> <<a href="mailto:dormando@rydia.net">dormando@rydia.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Khamis Siksek wrote:<br>> Dear all,<br>><br>> Is there a way to update a value in memcached using the difference?<br>><br>> For example if I cached an array (e.g. the result of a select query from<br>> a database) using the key 123:
<br>> set ('123', $a); // $a an array containing 10 rows<br>><br>> and after a while the table or fields got updated in the database, what<br>> I will need to do now is to do the same thing I did before which is set
<br>> ('123', $a); // now $a contains more or less rows with some modified fields<br>><br>> This means I have an overhead (the rows or fields that didn't change)<br>> that I need to cache again, so is there a way that makes me set only the
<br>> difference (same as patching a source file using diff -u result).<br>><br>> Regards,<br><br>It's probably not that huge of an overhead to reset an array of 10<br>items. If you're worried, split it out into more keys.
<br><br>I can vaguely recall binary patching being discussed here and there. The<br>consensus here is that it gets complicated. The client would need to<br>know the binary offsets to work with, which is not likely to be the
<br>common case at all. Easier to just work with it.<br><br>-Dormando<br></blockquote></div><br><br clear="all"><br>-- <br><br>Khamis Siksek<br><a href="http://saksoook.blogspot.com">http://saksoook.blogspot.com</a>