Thanks, nooby!

On Oct 26, 9:57 am, nooby <[email protected]> wrote:
> Hi,
>
>   If I understand correctly you want to modify the value without
> having the client fetching the value first.
>   Obviously this means that whatever value was there in the first
> place is not important so 'replace' operation should do the trick.
> That is, replace the value if and only if it already exists there.
>
> If you have many clients trying to do an update the last replace wins
> which might not be what you want. You might want to look at compare
> and set operation which obviously requires you to do a get first.
>
> Also take a look at the memcached FAQ for the "ghetto lock" in this
> case you would do a lock even if the value already existed because the
> client will modify it anyway i guess.
>
> i hope this helps...
>
> On Oct 19, 1:16 pm, Jorge <[email protected]> wrote:
>
> > 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!

Reply via email to