ZEO as a kind of memcache

Rafael Oliveira <[email protected]> Mon, 7 Aug 2017 17:44:48 -0300
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAP+kbOx2f8-DJs8+JbboTXUi2pdYOhjMwCCz9FLb=F89PD-mpw@mail.gmail.com>
Hi all,

I have a Zope 2 application, with multiple instances connecting to ZEO. I
have expensive computation output that I want to cache, and I want to share
this cache among the multiple instances I have.

It seems like a textbook case for memcache. However, I already have ZEO,
which is already there, talking to all instances. So, why not use ZEO as a
replacement for memcache?

I did some quick research and I thought this might work. I added an
in-memory storage to my zeo.conf:

    %import tempstorage
    <temporarystorage 2>
        name zeomemcache
    </temporarystorage>

And in the Zope instances I connect to it with a mount point:

    <zodb_db zeomemcache>
       cache-size 30000
       <zeoclient>
         server 127.0.0.1:3100
         storage 2
       </zeoclient>
       mount-point /zeomemcache
       container-class OFS.Folder.Folder
    </zodb_db>


It kind of works. I haven't tested it much yet. A problem I already found
is that when I restart the ZEO server the Zope instances complain with this
message: ClientStorageError: [('127.0.0.1', 3100)] Client has seen newer
transactions than server!

I'd like your feedback:

- Is this a very crazy idea? Why?
- What are the cons, comparing to memcache?
- Should I use other storage type, like mappingstorage?
- Anything similar I might consider?

Thanks!

Rafael Oliveira

-- 
You received this message because you are subscribed to the Google Groups "zodb" 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.