Memcache update the difference

Khamis Siksek khamis.siksek at gmail.com
Thu Aug 30 08:55:06 UTC 2007


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%.

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.

On 8/30/07, dormando <dormando at rydia.net> wrote:
>
> Khamis Siksek wrote:
> > Dear all,
> >
> > Is there a way to update a value in memcached using the difference?
> >
> > For example if I cached an array (e.g. the result of a select query from
> > a database) using the key 123:
> > set ('123', $a); // $a an array containing 10 rows
> >
> > and after a while the table or fields got updated in the database, what
> > I will need to do now is to do the same thing I did before which is set
> > ('123', $a); // now $a contains more or less rows with some modified
> fields
> >
> > This means I have an overhead (the rows or fields that didn't change)
> > that I need to cache again, so is there a way that makes me set only the
> > difference (same as patching a source file using diff -u result).
> >
> > Regards,
>
> It's probably not that huge of an overhead to reset an array of 10
> items. If you're worried, split it out into more keys.
>
> I can vaguely recall binary patching being discussed here and there. The
> consensus here is that it gets complicated. The client would need to
> know the binary offsets to work with, which is not likely to be the
> common case at all. Easier to just work with it.
>
> -Dormando
>



-- 

Khamis Siksek
http://saksoook.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070830/caeb9d7e/attachment.html


More information about the memcached mailing list