Hi,

You can write callback functions in libmemcached so that upon cache miss it 
will fetch data/populate Memcached.

Cheers,
        -Brian

On Aug 24, 2012, at 1:53 PM, Xun TANG <[email protected]> wrote:

> Thanks for the fast reply. 
> 
> I understand that memcached is a cache server, and mysql is a db server.
> In my case, the flow is like this: 
> for read, if cache hits, great, pass the value back directly; if miss, read 
> from mysql server.
> for write, if hits, write both cache and sql server; if miss, write only sql 
> server.
> 
> I personally do not care about how mysql caches queries, or how mysql batches 
> writes.
> I trust it to do its job efficiently. 
> 
> So it doesn't seem like memcached server could talk to mysql server directly.
> It has to be memcached server reply memcached client about the miss, 
> while the client takes care of the remote connection with mysql server.
> Is this correct?
> 
> Any comment welcome.
> 
> Thanks,
> Xun
> 
> On Fri, Aug 24, 2012 at 11:02 AM, Roberto Spadim <[email protected]> 
> wrote:
> check this: 
> http://dev.mysql.com/tech-resources/articles/nosql-to-mysql-with-memcached.html
> 
> 2012/8/24 Roberto Spadim <[email protected]>:
> > well, two different things...
> > one is a database server - mysql (that have a query cache, and others 
> > caches)
> > other is a cache server - memcached (that doesnt matter about losing
> > data, since it´s a cache)
> >
> >
> > mysql have some tools that you can set/get values in a innodb or ndb
> > table, but it´s a feature of mysql, you should search at dev mysql
> > site...
> >
> > i think this will help you :)
> > bye
> >
> > 2012/8/24 Xun TANG <[email protected]>:
> >> This is probably a silly question, but I am not able to find the answer
> >> googling.
> >>
> >> I know libmemcached is great in setting and getting key/value pair to and
> >> from the memcached server.
> >> Also our service engine is written in C++. This makes libmemcached a great
> >> fit for us.
> >>
> >> I looked through http://docs.libmemcached.org/ ,
> >> but can't find anything about how memcached client should interact with the
> >> database (MYSQL server in my case)
> >> when cache miss happened.
> >>
> >> Questions:
> >> 1. Is there a way to interact with MYSQL server in C++ with decent
> >> performance?
> >>
> >> 2. If no to question 1, which would you recommend?
> >> I see Perl, Python, PHP, Java, and even User-Defined Functions.
> >> If I do not have particular preference on the language, what are the pros
> >> and cons for each?
> >>
> >>
> >> Thanks ahead guys,
> >> Xun
> >>
> >
> >
> >
> > --
> > Roberto Spadim
> > Spadim Technology / SPAEmpresarial
> 
> 
> 
> --
> Roberto Spadim
> Spadim Technology / SPAEmpresarial
> 

Reply via email to