<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Most efficient way of modifying value</title>
        <description> Hello!

I would like to use memcached as a fast cache for  a hospital order
database.

Each order has a location (5 possible values), procedure (about 100
possible values),
and patient status (3 different values).

So, my thinking was for each order, create a key as follows:

(location code)_(procedure code)_(status code)

and the value would be a list of all orders matching a given code.

So, doing a query on a given location, procedure and status will just
entail reading the value from the key.

My question is: what is the best way of modifying the value, as an in-
memory list.

Can this be done on the memcached server, or do I need the client to
pull the value out,
modify it, and put it back in?

Thanks!</description>
        <link>http://www.serverphorums.com/read.php?9,217516,217516#msg-217516</link>
        <lastBuildDate>Fri, 24 May 2013 18:51:37 +0200</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://www.serverphorums.com/read.php?9,217516,221753#msg-221753</guid>
            <title>Re: Most efficient way of modifying value</title>
            <link>http://www.serverphorums.com/read.php?9,217516,221753#msg-221753</link>
            <description><![CDATA[ Thanks, rhohitk. I found out about redis after some further<br />
investigation; looks perfect for this problem.<br />
<br />
On Tue, Oct 26, 2010 at 3:58 PM, Rohit Karlupia &lt;iamrohit@gmail.com&gt; wrote:<br />
&gt; May be you are better off using redis which provides some in memory pre<br />
&gt; built data structures like lists and sets.<br />
&gt; thanks!<br />
&gt; rohitk<br />
&gt;<br />
&gt; On Tue, Oct 19, 2010 at 10:46 PM, Jorge &lt;boxerab@gmail.com&gt; wrote:<br />
&gt;&gt;<br />
&gt;&gt; Hello!<br />
&gt;&gt;<br />
&gt;&gt; I would like to use memcached as a fast cache for  a hospital order<br />
&gt;&gt; database.<br />
&gt;&gt;<br />
&gt;&gt; Each order has a location (5 possible values), procedure (about 100<br />
&gt;&gt; possible values),<br />
&gt;&gt; and patient status (3 different values).<br />
&gt;&gt;<br />
&gt;&gt; So, my thinking was for each order, create a key as follows:<br />
&gt;&gt;<br />
&gt;&gt; (location code)_(procedure code)_(status code)<br />
&gt;&gt;<br />
&gt;&gt; and the value would be a list of all orders matching a given code.<br />
&gt;&gt;<br />
&gt;&gt; So, doing a query on a given location, procedure and status will just<br />
&gt;&gt; entail reading the value from the key.<br />
&gt;&gt;<br />
&gt;&gt; My question is: what is the best way of modifying the value, as an in-<br />
&gt;&gt; memory list.<br />
&gt;&gt;<br />
&gt;&gt; Can this be done on the memcached server, or do I need the client to<br />
&gt;&gt; pull the value out,<br />
&gt;&gt; modify it, and put it back in?<br />
&gt;&gt;<br />
&gt;&gt; Thanks!<br />
&gt;&gt;<br />
&gt;<br />
&gt;]]></description>
            <dc:creator>Aaron Boxer</dc:creator>
            <category>Memcached</category>
            <pubDate>Tue, 26 Oct 2010 23:30:07 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?9,217516,221707#msg-221707</guid>
            <title>Re: Most efficient way of modifying value</title>
            <link>http://www.serverphorums.com/read.php?9,217516,221707#msg-221707</link>
            <description><![CDATA[ On Oct 19, 10:16 am, Jorge &lt;boxe...@gmail.com&gt; wrote:<br />
<br />
&gt; My question is: what is the best way of modifying the value, as an in-<br />
&gt; memory list.<br />
<br />
    Just append the new value with some sort of separator.<br />
<br />
&gt; Can this be done on the memcached server, or do I need the client to<br />
&gt; pull the value out,<br />
&gt; modify it, and put it back in?<br />
<br />
    If you need something more complex than append, you can build save<br />
an arbitrarily complex transformations with CAS.]]></description>
            <dc:creator>Dustin</dc:creator>
            <category>Memcached</category>
            <pubDate>Tue, 26 Oct 2010 22:20:11 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?9,217516,221679#msg-221679</guid>
            <title>Re: Most efficient way of modifying value</title>
            <link>http://www.serverphorums.com/read.php?9,217516,221679#msg-221679</link>
            <description><![CDATA[ May be you are better off using redis which provides some in memory pre<br />
built data structures like lists and sets.<br />
<br />
thanks!<br />
rohitk<br />
<br />
<br />
On Tue, Oct 19, 2010 at 10:46 PM, Jorge &lt;boxerab@gmail.com&gt; wrote:<br />
<br />
&gt; Hello!<br />
&gt;<br />
&gt; I would like to use memcached as a fast cache for  a hospital order<br />
&gt; database.<br />
&gt;<br />
&gt; Each order has a location (5 possible values), procedure (about 100<br />
&gt; possible values),<br />
&gt; and patient status (3 different values).<br />
&gt;<br />
&gt; So, my thinking was for each order, create a key as follows:<br />
&gt;<br />
&gt; (location code)_(procedure code)_(status code)<br />
&gt;<br />
&gt; and the value would be a list of all orders matching a given code.<br />
&gt;<br />
&gt; So, doing a query on a given location, procedure and status will just<br />
&gt; entail reading the value from the key.<br />
&gt;<br />
&gt; My question is: what is the best way of modifying the value, as an in-<br />
&gt; memory list.<br />
&gt;<br />
&gt; Can this be done on the memcached server, or do I need the client to<br />
&gt; pull the value out,<br />
&gt; modify it, and put it back in?<br />
&gt;<br />
&gt; Thanks!<br />
&gt;<br />
&gt;]]></description>
            <dc:creator>Rohit Karlupia</dc:creator>
            <category>Memcached</category>
            <pubDate>Tue, 26 Oct 2010 22:00:15 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?9,217516,221603#msg-221603</guid>
            <title>Re: Most efficient way of modifying value</title>
            <link>http://www.serverphorums.com/read.php?9,217516,221603#msg-221603</link>
            <description><![CDATA[ On Oct 26, 6:57 am, nooby &lt;arce.emi...@gmail.com&gt; wrote:<br />
<br />
&gt;   Obviously this means that whatever value was there in the first<br />
&gt; place is not important so 'replace' operation should do the trick.<br />
&gt; That is, replace the value if and only if it already exists there.<br />
<br />
  I wouldn't recommend the replace operation in general.  All it means<br />
is ``only fail if I'm not destroying data somewhere.''  You can't make<br />
any assumptions as to what data is being destroyed.<br />
<br />
  Any place where you'd use replace, you probably want either plain<br />
set or set with a CAS.]]></description>
            <dc:creator>Dustin</dc:creator>
            <category>Memcached</category>
            <pubDate>Tue, 26 Oct 2010 19:50:14 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?9,217516,221584#msg-221584</guid>
            <title>Re: Most efficient way of modifying value</title>
            <link>http://www.serverphorums.com/read.php?9,217516,221584#msg-221584</link>
            <description><![CDATA[ Hi,<br />
<br />
  If I understand correctly you want to modify the value without<br />
having the client fetching the value first.<br />
  Obviously this means that whatever value was there in the first<br />
place is not important so 'replace' operation should do the trick.<br />
That is, replace the value if and only if it already exists there.<br />
<br />
If you have many clients trying to do an update the last replace wins<br />
which might not be what you want. You might want to look at compare<br />
and set operation which obviously requires you to do a get first.<br />
<br />
Also take a look at the memcached FAQ for the &quot;ghetto lock&quot; in this<br />
case you would do a lock even if the value already existed because the<br />
client will modify it anyway i guess.<br />
<br />
i hope this helps...<br />
<br />
<br />
<br />
On Oct 19, 1:16 pm, Jorge &lt;boxe...@gmail.com&gt; wrote:<br />
&gt; Hello!<br />
&gt;<br />
&gt; I would like to use memcached as a fast cache for  a hospital order<br />
&gt; database.<br />
&gt;<br />
&gt; Each order has a location (5 possible values), procedure (about 100<br />
&gt; possible values),<br />
&gt; and patient status (3 different values).<br />
&gt;<br />
&gt; So, my thinking was for each order, create a key as follows:<br />
&gt;<br />
&gt; (location code)_(procedure code)_(status code)<br />
&gt;<br />
&gt; and the value would be a list of all orders matching a given code.<br />
&gt;<br />
&gt; So, doing a query on a given location, procedure and status will just<br />
&gt; entail reading the value from the key.<br />
&gt;<br />
&gt; My question is: what is the best way of modifying the value, as an in-<br />
&gt; memory list.<br />
&gt;<br />
&gt; Can this be done on the memcached server, or do I need the client to<br />
&gt; pull the value out,<br />
&gt; modify it, and put it back in?<br />
&gt;<br />
&gt; Thanks!]]></description>
            <dc:creator>nooby</dc:creator>
            <category>Memcached</category>
            <pubDate>Tue, 26 Oct 2010 19:30:06 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?9,217516,217516#msg-217516</guid>
            <title>Most efficient way of modifying value</title>
            <link>http://www.serverphorums.com/read.php?9,217516,217516#msg-217516</link>
            <description><![CDATA[ Hello!<br />
<br />
I would like to use memcached as a fast cache for  a hospital order<br />
database.<br />
<br />
Each order has a location (5 possible values), procedure (about 100<br />
possible values),<br />
and patient status (3 different values).<br />
<br />
So, my thinking was for each order, create a key as follows:<br />
<br />
(location code)_(procedure code)_(status code)<br />
<br />
and the value would be a list of all orders matching a given code.<br />
<br />
So, doing a query on a given location, procedure and status will just<br />
entail reading the value from the key.<br />
<br />
My question is: what is the best way of modifying the value, as an in-<br />
memory list.<br />
<br />
Can this be done on the memcached server, or do I need the client to<br />
pull the value out,<br />
modify it, and put it back in?<br />
<br />
Thanks!]]></description>
            <dc:creator>Jorge</dc:creator>
            <category>Memcached</category>
            <pubDate>Tue, 19 Oct 2010 19:30:07 +0200</pubDate>
        </item>
    </channel>
</rss>
