Standard memcached itself can't update the database for you, since it only
responds to requests from other servers and never initiates its own. The
way I've seen this solved is to have your application first modify the
database, then delete the value from memcached. Then on the read path, you
try to read from memcached and in the case of a miss, you read from the
database and write that back to memcached. This is what is known as a
look-aside caching strategy.

An alternative is to have your application update both the database and the
cache, but if you have racing writes, this is an easy way to end up with
cache inconsistencies.


On Fri, Aug 1, 2014 at 5:20 AM, Tristup Ghosh <[email protected]> wrote:

> Hi,
>
> My question is how to update a value to db by using the memcached. If I am
> set a new value to cache using my application and I want it to be updated
> to database, is it possible if yes please help.
> Thanks in advance.
>
> Regards
> Tristup Ghosh
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "memcached" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to